how do i make my menus look like the ones in Office XP?
Printable View
how do i make my menus look like the ones in Office XP?
Here ya go http://www.dotnetmagic.com/
is thre a simpler way?
Thanks DevGrp.
A simpler way? What is simpler than a control that does it all for you?
ROTFL
here is a good and simple example of XP Style menu.
using "OwnerDraw" Pro. you can draw any style you want.
some arg.:
1-MeasureItem : used to take the dimention of the menu.
2-DrawImage : used to draw the image stored in the imagelist on the menu .
3-DrawLine : draw a line with specific sizes .
4-DrawRectangle : draw rectangle with specific color on specific region.
5-DrawString :write text on specific region with special charat.
6-FillRectangle : fill a rectangle region with specific color
Pirate
:D sorry forget the attachment. It's there
That was pretty cool pirate.
thanks, worked perfect with a bit of tweaking o make it look like XP style menu's. thinking of making a dll so faster access. pirate have a prob?
yup:D
Pirate,
I follow your project, and added the following code.
I want to leave all the default properties of the menu. So I only add these code.
Private Sub MenuItem2_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles MenuItem2.DrawItem
e.Graphics.FillRectangle(New SolidBrush(Color.FromName(System.Drawing.KnownColor.Control)), e.Bounds.X, e.Bounds.Y, e.Bounds.X + 32, e.Bounds.Height)
e.Graphics.DrawString(sender.text, New Font(System.Drawing.FontFamily.GenericSansSerif, 8.25), New SolidBrush(Color.FromName(System.Drawing.KnownColor.MenuText)), 35, e.Bounds.Y + 5)
e.Graphics.DrawString(sender.Shortcut.ToString, New Font(System.Drawing.FontFamily.GenericSansSerif, 8.25), New SolidBrush(Color.FromName(System.Drawing.KnownColor.MenuText)), 150, e.Bounds.Y + 5)
e.Graphics.DrawImage(ImageList1.Images.Item(0), e.Bounds.X + 7, e.Bounds.Y + 5)
End Sub
I can't see any icon beside the menu item. So I add this code also:
Private Sub MenuItem2_MeasureItem(ByVal sender As Object, ByVal e As System.Windows.Forms.MeasureItemEventArgs) Handles MenuItem2.MeasureItem
e.ItemHeight = 25
e.ItemWidth = 200
End Sub
But my menu still does not have any icon beside. why?
Please guide. Thank you.
Check your post there ...
Thanks for your reply. I will check my post n try it out...
Try this link :
http://www.vbsmart.com/
I have used this control in both VB6 and .NET and it seems to work like a dream. A really good example of an alternative to owner drawn menus, easy to use and free as well.
And what's wrong with Owner Drawn Menus ??? That example uses same methods as the above .Quote:
Originally posted by MattJH
Try this link :
http://www.vbsmart.com/
I have used this control in both VB6 and .NET and it seems to work like a dream. A really good example of an alternative to owner drawn menus, easy to use and free as well.
Pirate,
I tried to use the code you posted for OwnerDrawMenus. I was able to get my form to load and the menu come up with the color. I receive an error when I click on the menu:
An unhandled exception of type 'System.OutOfMemoryException' occurred in system.drawing.dll
Additional information: Out of memory.
Any suggestions on why this might be happening?
Thanks
I am new this owner drawn menus but I like it and especially like yours. I am trying to add a second menu with submenus but not having any luck. Do you have a example with more than one dropdown menu. IE. First menu choice is File, Second is Edit. Thanks if you can help
Ok I figured it out, just slow I guess. I havent been able to figure out how to remove the shortcuts ie. CTL-A. I get it say NONE but would prefer to remove the word totally. I have tried setting the property show shortcut to false but it still showing. Have you tried this?
pirate,
can u also plz help me out.......
i also need to change the color of my main menu and toolbar.......being a new member i just went through the steps u hav been tellin others to get the colored menu....but i am not a pro in .net, i am still learning.....so i would really appreciate if u could explain me "ownerdraw menu" coding.
Please can you tell me how you used it ?Quote:
Originally Posted by MattJH
When i try to put it on a form it tells me :
"SmartmenuXP objects can be placed on forms only"
Check out this link for "Ultimate Menus".. looks promising..
http://www.codeproject.com/vb/net/UltimateMenus.asp
***Edit - he has an updated version of this at the following link
http://www.planet-source-code.com/vb...3325&lngWId=10
Menus are every thing to my applications.
I know this is an old thread. But i wanna revive it.
Has some one used Kunal's KMMenuComponent with MDI's in the Updated Link above.
I have an MDI with a menu and other forms with menu's too which do merge with the menus on the MDI. But when i try to use this tool. My Menus get puked up when i load another form that has menus too.
If some one has gone this direction with this tool or another equally good tool. Please point me to the right direction.
I am using the ComponentOne suite, which has a great menu control.
Thanks MattJH. I will peep there.
Edit:**** That was good. But how can hoop over that Licence?