How to add custom winforms MenuItem to MainMenu


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: How to add custom winforms MenuItem to MainMenu

  1. #1
    Join Date
    Jan 2010
    Posts
    3

    How to add custom winforms MenuItem to MainMenu

    Hi all, I'm working with VB 2003 .NET 1.1

    I would like to create a custom MainMenu control that use custom MenuItem.
    My problem is when I'm editing the custom MainMenu control in design-time, it creates System.Windows.Forms.MenuItem instead of my custom MenuItem.

    How can I tell the designer to use my custom MenuItem?

    Thank you for your help.

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    In Code view, go into the region labeled "Windows Forms Designer Generated Code" and change the control class from System.Windows.Forms.MenuItem to the name of your custom class.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Jan 2010
    Posts
    3
    Thank you for your answer but I don't want to do this manually in code view. I would like the designer to automatically generate my custom class each time I add a MenuItem into the MainMenu in design-time.

  4. #4
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    I don't think that's possible. The designer doesn't know about your custom class.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. Replies: 4
    Last Post: 04-22-2009, 06:38 PM
  2. Replies: 0
    Last Post: 12-11-2002, 07:05 PM
  3. Displaying XML Data using .Net Controls
    By Greg Rothlander in forum ASP.NET
    Replies: 1
    Last Post: 11-27-2001, 07:09 PM
  4. Replies: 6
    Last Post: 12-26-2000, 11:01 AM
  5. Replies: 0
    Last Post: 12-25-2000, 05:55 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center