Groups | Blog | Home
all groups > dotnet general > july 2004 >

dotnet general : Toolbars and Menus


Raj Singh Sisodia
7/20/2004 11:38:01 PM
Hello Sir/Madam,
I am tring to create Menu and toolbar controls that looks like the one used in Office Xp. I have trird using the Menu class to create my own myMainMenu and MyMenuItem but in Ide after I put myMainMenu and try to create the subitems it creates MenuItem rather than myMenuItem how do i solve this problem. Also what would be the right way to achive my target create from scratch or use these base classes. If you could frovide any further information that I havent aksed you are most welcome. Also I am a VB.NET not c# so please keep that in mind when you reply.

Regards
Raj Singh Sisodia
--
Mick Doherty
7/21/2004 12:20:30 PM
The MenuDesigner is Private so you cannot derive from MainMenu and get it to
use your custom menuitems.
You have options though:

1. Code the Paint and MeasureItem Events for every MenuItem after setting
them to OwnerDraw.

2. Create your menu as usual and, once you've defined all the menuitems,
expand the 'Windows Form Designer generated code' region and do a search and
replace of 'System.Windows.Forms.MenuItem' with 'MyNameSpace.MyMenuItem'
(assuming that's the NameSpace and Name of your custom MenuItem)

3. Create a MenuExtender component to extend the properties of standard
MenuItems.

An Office Style Menu Class(Source Code)
http://dotnetrix.co.uk/menus.html

A MenuExtender(No Source, but you will find source for similar components
via Google)
http://dotnetrix.co.uk/controls.html --> MenuSkinner

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html


"Raj Singh Sisodia" <RajSinghSisodia@discussions.microsoft.com> wrote in
message news:D478CB2C-3950-45E9-A89C-AE6F48921FA4@microsoft.com...
[quoted text, click to view]
used in Office Xp. I have trird using the Menu class to create my own
myMainMenu and MyMenuItem but in Ide after I put myMainMenu and try to
create the subitems it creates MenuItem rather than myMenuItem how do i
solve this problem. Also what would be the right way to achive my target
create from scratch or use these base classes. If you could frovide any
further information that I havent aksed you are most welcome. Also I am a
VB.NET not c# so please keep that in mind when you reply.
[quoted text, click to view]


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.719 / Virus Database: 475 - Release Date: 12/07/2004

Raj Singh Sisodia
7/21/2004 10:22:02 PM
Hello Mick,
Thanks for your reply, it really helped me but actually I am tring to make a control and I dont want to write any extra code to use it. I want it to be as simple as using the menus provided by >net ramework or the other 3rd party controls.
I think I will go by your advise to create an extender.
Thank you again for your help.

Best Regards
Raj Singh Sisodia
--
I am here to solve problems and add a few of mine to yours


[quoted text, click to view]
AddThis Social Bookmark Button