Is it possible to make a Context menu so that the menu items were
side-to-side:
Copy / Paste
Cut / Process
... / ...
The Win32 API lets you split a menu in multiple columns. You can use
code such as this
struct MENUITEMINFO {
public int cbSize;
public uint fMask;
public uint fType;
public uint fState;
public uint wID;
public IntPtr hSubMenu;
public IntPtr hbmpChecked;
public IntPtr hbmpUnchecked;
public IntPtr dwItemData;
public IntPtr dwTypeData;
public uint cch;
public IntPtr hbmpItem;
}
....
[DllImport("user32.dll", CharSet=CharSet.Auto)]
static extern bool SetMenuItemInfo(IntPtr hMenu, uint uItem, bool
fByPosition, ref MENUITEMINFO lpmii);
....
const uint MIIM_FTYPE = 0x100;
const uint MFT_MENUBARBREAK = 0x20;
const uint MFT_MENUBREAK = 0x40;
MENUITEMINFO mii = new MENUITEMINFO();
mii.cbSize = Marshal.SizeOf( typeof(MENUITEMINFO) );
mii.fMask = MIIM_FTYPE;
mii.fType = MFT_MENUBREAK;
SetMenuItemInfo( YourContextMenu.Handle, idx, true, ref mii );
where idx is the index of the item you want to break on. Replace
MFT_MENUBREAK with MFT_MENUBARBREAK if you want a vertical divider to
appear between the columns.
Mattias