|
-
Jan 9th, 2003, 10:35 PM
#1
Thread Starter
Addicted Member
Owner-drawn menus
I already know how to make an owner-drawn menu usind drawitem and measure item in the form's code, but how would I create this in a usercontrol. If I inherit from System.Windows.Forms.MainMenu then I don't get the DrawItem even as that's in the System.windows.forms.MenuItem class.
I'm fairly new to VB.NET and am just experimenting with this stuff.
Thank in advanced...
-
Jan 9th, 2003, 10:49 PM
#2
Make an inherited MenuItem class instead.
-
Jan 10th, 2003, 12:00 AM
#3
Thread Starter
Addicted Member
Okay, but then how do I have the MainMenu, as part of my control, utilize my class inherited from MenuItem rather than System.Windows.Forms.MenuItem?
-
Jan 10th, 2003, 12:05 AM
#4
I'm not sure I know what you mean. If you want to make a Mainmenu then you could make one of those as well. If you mean how will the normal Mainmenu control accept your custom Menuitem, as long as your extended MenuItem inherits the normal Menuitem it will accept it. To the Mainmenu it'll work just like a normal Menuitem, but your class can override some important events to change that without interfering with the Mainmenu control.
-
Jan 10th, 2003, 05:08 AM
#5
I think I have a similar problem. I have a context menu on a list that allows the user to add the selected item to a treeview. I want to customise the <Add> menu item so that is has a text box over the button allowing the user to enter the number of items to be added.
Is this along the same lines? I don't want to hi-jack the thread.
I've created a UserControl that inherits from MenuItem and added a text box to it.
In my code I create a new ContextMenu and add my usercontrol to its MenuItems. However, the textbox in the UserControl doesn't appear on the screen.
Any ideas?
This world is not my home. I'm just passing through.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|