473,795 Members | 3,231 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2004

"VMI" <vo******@yahoo .com> wrote in message
news:eb******** ******@TK2MSFTN GP10.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("user 32.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_MENUBARBREA K = 0x20;
const uint MFT_MENUBREAK = 0x40;

MENUITEMINFO mii = new MENUITEMINFO();
mii.cbSize = Marshal.SizeOf( typeof(MENUITEM INFO) );
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_MENUBARBREA K 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
2074
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" (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpatterns/html/ImpFrontControllerInASP.asp Everything works well except for context.server.transfer(string url) method (refer to RedirectingCommand.cs class in the above documentation) Here are the error details Server...
10
2434
by: chessc4c6 | last post by:
Can someone explain to me hoe both C and C++ are context sensitive??
0
339
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 Synhronised(lock,func): lock.acquire() try: func()
0
1344
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 started adding Context-sensitive help to my Access 2000 application. On the first form I am working on, it seems that the text boxes respond to the Context-sensitive 'What's this ?' but the labels and image controls do not, even though they have...
1
5165
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
905
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 context.application during processing. Everything works fine, as long as not more than 1 user is on the server. Under conditions unknown to me, this class looses the reference to Context.Request, Context.Application context.Session and other objects. It occurs,...
1
2548
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 some Database operations, each thread will do some work on the DB using its own SQLConnection. I want the 2 SQLConnections of the two threads partecipate to the same (distributed) transaction. The problem is that i do not know how to propagate...
3
2040
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), when the program goes from the login page to the next page - the roles in the Context.User is empty. My Login page is: *****************************************************************
4
4692
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 connection to database may remain open for all application run time. For such a long time, some routers close connection. This causes Connection is broken error in application. How to fix this ?
4
11957
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 dialog box has as the default file name the name of this ashx file. I'd like to make that name more meaningfull but don't know how it gets set. I'm looking for a Response.Write but don't find one. Maybe that why the
0
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10435
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10213
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10163
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6779
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.