|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to open menu programmaticallyI am using Windows Forms, C#, VS2005.
I am developing an assistant that will guide a user through the application. At some point I need to open specific menus just like the user would by moving a mouse over it (for example, open File submenu in the Main menu). How can I do it from the code? Gregory "Gregory K" <Grego***@discussions.microsoft.com> az alábbiakat Ãrta a következÅ‘ üzenetben news:A06A73D7-42C0-4578-BB4B-BFD9AD819C25@microsoft.com... Hi,> I am using Windows Forms, C#, VS2005. > I am developing an assistant that will guide a user through the > application. > At some point I need to open specific menus just like the user would by > moving a mouse over it (for example, open File submenu in the Main menu). > How can I do it from the code? > Gregory Try using the ShowDropDown method. ( http://msdn.microsoft.com/en-us/library/system.windows.forms.toolstripdropdownitem.showdropdown.aspx ) Hope You find this useful. -Zsolt I have another question. How can I programmatically show the context menu of
a TreeNode? I tried node.ContextMenuStrip.Show() but it shows the menu in a wrong location. I can determine absolute location of the node at run time and use it as a parameter to Show() but it's not trivial. I hope there is a better way. Gregory "Gregory K" <Grego***@discussions.microsoft.com> wrote in message Nope, that's the only way. Why do you say it's not trivial, though? Just use news:1E1CED95-84D1-4C2D-977E-15A1BB5DB5C5@microsoft.com... >I have another question. How can I programmatically show the context menu >of > a TreeNode? I tried node.ContextMenuStrip.Show() but it shows the menu in > a > wrong location. I can determine absolute location of the node at run time > and > use it as a parameter to Show() but it's not trivial. I hope there is a > better way. the Show() overload that takes a Control and a Point, and use the parent tree view as the Control and extract a Point from the node's Bounds property.
Other interesting topics
Alternative to strongly typed datasets
static classes are evil ? System.Windows.Forms.Control.Handle==HWND? Getting started with a Kiosk-like application Uisng ADO.Net The Entity Framework Pass Variable At Design Time Read From Application Config File In Class Library Form transparency setting the value to the combo box passing vales from one form to another |
|||||||||||||||||||||||