473,401 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

Can a context menu have side-by-side menu items?

VMI
Usually, Windows context menus have menu items that go from top to bottom:

Copy
Paste
Cut
Process
....
....

Is it possible to make a Context menu so that the menu items were
side-to-side:

Copy / Paste
Cut / Process
.... / ...

Thanks.
Nov 16 '05 #1
2 1983

"VMI" <vo******@yahoo.com> wrote in message
news:eb**************@TK2MSFTNGP10.phx.gbl...
Usually, Windows context menus have menu items that go from top to bottom:

Copy
Paste
Cut
Process
...
...

Is it possible to make a Context menu so that the menu items were
side-to-side:

Copy / Paste
Cut / Process
... / ...

Thanks.


I do not believe so, atleast not with the ContextMenu class. It may be
possible with a custom context menu class, but that would take more
knowledge than I have about Win32 menu's.
Nov 16 '05 #2
>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

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Srini | last post by:
I am implementing Front Controller in ASP.net as outlined in Microsoft documentation titled "Implementing Front Controller in ASP.NET Using HTTPHandler"...
10
by: chessc4c6 | last post by:
Can someone explain to me hoe both C and C++ are context sensitive??
0
by: falcon | last post by:
I know I came after the battle. And I have just another sight on context managment. Simple Context Managment may look in Python 2.4.1 like this: Synhronized example: def...
0
by: ctyrrell | last post by:
Does anyone know of any restrictions of controls on Access forms that makes them ineligible for Context-Sensitive help? Are some types of controls not able to be made context-sensitive? I have...
1
by: joel.washburn | last post by:
I've noticed that fsockopen (as of PHP 5) no longer accepts context. How can I make an SSL connection (requiring a client cert) without using curl?
0
by: Beat | last post by:
I have a big .NET 2.0 Web Application written in VB. One page passes a reference to context to a class where the processing is done. The class uses context.session, context.request...
1
by: Gian Paolo Clarici | last post by:
I've a problem using multithreading and MTS. I'm using framework 1.1 Basically I want, from the Main Thread , to start a (distributed) transaction. then I want to start 2 new threads to perform...
3
by: tshad | last post by:
I am playing with GenericPrincipal classes and am using a sample program to test it. The problem is that even though I set the roles (which shows the roles in the Context.User as being there),...
4
by: Andrus | last post by:
For winforms application with multiple related forms it is reasonable to create Linq database context object in start of application. Context object is released only when application exits. So...
4
by: AAaron123 | last post by:
trying to understand the below shown code. After this is run the browser opens a file-save dialog box for saving the file. I wonder how it knows I want the file saved? But more important, the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.