Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / April 2005

Tip: Looking for answers? Try searching our database.

Edit a Menu in a component using Visual Studio

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeronimo Bertran - 18 Apr 2005 23:08 GMT
Hi,

If I add a menu (or context menu) to a component class by dragging it from
the toolbox, it is added correctly but I can't find a way to edit it.  The
Edit Menu command appears in the context menu for the item but it doesn't
seem to do anything.

Thanks,

Jeronimo Bertran
"Jeffrey Tan[MSFT]" - 19 Apr 2005 03:16 GMT
Hi Jeronimo,

Thanks for your post!!

Based on my understanding, you want to use ContextMenu and MainMenu in your
Winform applicaiton, but you do not know how to edit these 2 menu
components in VS.net IDE. If I misunderstand you, please feel free to tell
me. Thanks

If we drag a MainMenu component onto the VS.net designer, it will appear on
the component tray just below the designer Form. When we select the
MainMenu component in the component tray, the text "Type Here" is displayed
in the Form Designer just below the caption bar, click the displayed text,
and type the name of the desired menu item to add it.
To add another menu item, click another "Type Here" area within the Menu
Designer.
1. Click the area to the right of the current menu item to add a submenu.
-or-
2. Click the area below the current menu item to add another entry to the
same menu.

Then, the edited MainMenu component is associated with the current form.

For ContextMenu, the edit way is almost the same with MainMenu component.
But to associate the context menu with the form or a control on the form,
we should set that control's ContextMenu property in the Properties window.
Once the setting is done, we can run the winform application, and when we
right click that control, our context menu will display out.

For more information, you may refer to the below official document:
"Adding Menus and Menu Items to Windows Forms"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/
vbtskaddingmenusitemstomenu.asp
"Editing Names of Menu Items for Windows Forms"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/
vbtskeditingnamesofmenus.asp
"Adding Context Menus to Windows Forms"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/
vbtskaddingcontextmenustoform.asp

Hope this helps
==================================================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jeronimo Bertran - 19 Apr 2005 03:44 GMT
Hi Jeffrey..

The problem is that I am trying to add the menus to a component and NOT to
a form.

From my project, I add a new item and select Component Class.  I then drag
a menu to the component.  

I am able to add the menu to the component but since a component does not
have a desginer form, I can't find a way to edit it.  The reason I want to
add a menu to a component is that I want to create a "predefined" menu that
can be added to multiple forms by dragging it from the toolbox.

Thanks again,

Jeronimo Bertran
"Jeffrey Tan[MSFT]" - 19 Apr 2005 08:44 GMT
Hi Jeronimo,

Thanks for your feedback!!

With your further statement, I think I understand your problem much better
now.

Oh, I do not think this is a suitable way of getting what you want. I think
we should create a customized MyMainMenu component, which inherits from the
MainMenu class. Then we can extend the MainMenu class's functions. But, we
can only extend the MainMenu class's function through code in .cs file, not
through the Visual Designer. This is recommended way of extending a
component's function.
=====================================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

"Jeffrey Tan[MSFT]" - 21 Apr 2005 06:17 GMT
Hi Jeronimo,

Does my reply make sense to you? If you still have concern on this issue,
please feel free to feedback. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.