|
-
Oct 22nd, 2002, 10:48 AM
#1
Thread Starter
Hyperactive Member
Office XP Style Menu's in vb.net?
how do i make my menus look like the ones in Office XP?
-
Oct 22nd, 2002, 12:09 PM
#2
Frenzied Member
Dont gain the world and lose your soul
-
Oct 22nd, 2002, 02:55 PM
#3
Thread Starter
Hyperactive Member
-
Oct 22nd, 2002, 03:01 PM
#4
Thanks DevGrp.
A simpler way? What is simpler than a control that does it all for you?
-
Oct 22nd, 2002, 03:13 PM
#5
yay gay
-
Oct 22nd, 2002, 03:35 PM
#6
Sleep mode
very easy way to simulate XP Style Menu
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
-
Oct 22nd, 2002, 03:38 PM
#7
-
Oct 22nd, 2002, 07:17 PM
#8
Frenzied Member
That was pretty cool pirate.
Dont gain the world and lose your soul
-
Oct 22nd, 2002, 08:48 PM
#9
Thread Starter
Hyperactive Member
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?
-
Oct 25th, 2002, 11:00 AM
#10
-
May 17th, 2003, 03:01 AM
#11
Registered User
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.
-
May 17th, 2003, 07:37 AM
#12
Sleep mode
Check your post there ...
-
May 21st, 2003, 08:26 PM
#13
Registered User
Thanks for your reply. I will check my post n try it out...
-
Jun 26th, 2003, 10:51 AM
#14
Hyperactive Member
If you don't want owner drawn menus
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.
-
Jun 26th, 2003, 12:04 PM
#15
Sleep mode
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.
And what's wrong with Owner Drawn Menus ??? That example uses same methods as the above .
-
Oct 8th, 2003, 03:50 PM
#16
Lively Member
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
-
Jul 30th, 2004, 10:23 AM
#17
Fanatic Member
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
-
Jul 30th, 2004, 10:42 AM
#18
Fanatic Member
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?
-
Mar 15th, 2005, 10:29 AM
#19
New Member
Re: Office XP Style Menu's in vb.net?
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.
-
Oct 17th, 2005, 03:00 AM
#20
Fanatic Member
Re: If you don't want owner drawn menus
 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.
Please can you tell me how you used it ?
When i try to put it on a form it tells me :
"SmartmenuXP objects can be placed on forms only"
-
Oct 17th, 2005, 03:09 AM
#21
Re: Office XP Style Menu's in vb.net?
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
Last edited by gigemboy; Oct 17th, 2005 at 03:14 AM.
-
Mar 28th, 2006, 11:32 AM
#22
Addicted Member
Re: Office XP Style Menu's in vb.net?
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.
-
Mar 29th, 2006, 03:42 AM
#23
Hyperactive Member
Re: Office XP Style Menu's in vb.net?
I am using the ComponentOne suite, which has a great menu control.
-
Mar 29th, 2006, 04:10 AM
#24
Addicted Member
Re: Office XP Style Menu's in vb.net?
Thanks MattJH. I will peep there.
Edit:**** That was good. But how can hoop over that Licence?
Last edited by skea; Mar 29th, 2006 at 04:19 AM.
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
|