473,231 Members | 1,498 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

Creating Menus, Submenus and Menuitems at runtime

Hi Everybody,

This is the first timw I am entering into this Group.

I am developing a VB Project with an MDI form.

I want to display IE Favorites into my application. For this I need to
create Submenus and Menuitems dynamically. It is possible to create
menus using array index. But if I have multiple folders and files in
Favorites then using array index will not work.

Can anyone in this group help me ?

I need source code with an example.

Thanks & Regards
Venkatesh
Jul 17 '05 #1
1 11289
: I want to display IE Favorites into my application. For this I need to
: create Submenus and Menuitems dynamically. It is possible to create
: menus using array index.

Somewhat. In order to create a dynamic menu in VB you must have at least one
member already created at design time. The remaining items are added via the
Load statement, just as with control arrays. This means that to have a menu
that displays sublevels under main items (ie Favorites > Microsoft >
Development and Favorites > Microsoft > Office), you have to have an empty
template under the Favorites and Microsoft items. If the Office folder
contains Office > Word, Office> Excel and Office > Frontpage, then you will
need to have constructed your design time menu with a blank item at this new
sub level. IOW, if the favorites folder contains items n levels deep, your
app has to have blank items n items deep in order to display the menu as it
would appear in IE.

And from what I can see in a quick scan of the MSDN, VB's Control.Add()
method, which provides for adding new controls at runtime without the need
for a template item, is not applicable to menus.
: But if I have multiple folders and files in
: Favorites then using array index will not work.

It is possible to do this (the above) using Windows API, then attaching the
menu to the app, however the VB form will be unaware it has a menu and all
coding for detection of the user's selection would need to be made through
subclassing.

Many VB apps I've seen that require such dynamic menu functionality,
especially for favorites, have resorted to using other controls such as a
treeview displayed in response to a toolbar item click. Not a perfect
solution however.
--

Randy Birch
MVP Visual Basic
http://www.mvps.org/vbnet/
Please respond only to the newsgroups so all can benefit.
"Venkatesh" <mv**************@hotmail.com> wrote in message
news:c7**************************@posting.google.c om...
: Hi Everybody,
:
: This is the first timw I am entering into this Group.
:
: I am developing a VB Project with an MDI form.
:
: I want to display IE Favorites into my application. For this I need to
: create Submenus and Menuitems dynamically. It is possible to create
: menus using array index. But if I have multiple folders and files in
: Favorites then using array index will not work.
:
: Can anyone in this group help me ?
:
: I need source code with an example.
:
: Thanks & Regards
: Venkatesh
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Raj Singh Sisodia | last post by:
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...
0
by: Andrew Baker | last post by:
Have a look at the code below. It's a really simple example where I have added two controls to a form, a textbox and a combo box. Both add owner drawn context menus to the controls, but the...
4
by: ssg31415926 | last post by:
I've got a ListView which can show many different types of object. I need to display a ContextMenu whose MenuItems depend on the object type. I was planning to pre-create the ContextMenus when...
5
by: Sandy | last post by:
How do you create menu items with submenus? An example of what I'm referring to are the microsoft menus to the left of this page with the arrows that show additional topics. -- Sandy
1
by: paulakeijzers | last post by:
I've got a problem with asp.net i am trying to make a menu control. and have searched the web for serveral controls but they don't work correctly. I am pretty new to asp.net building. What am i...
4
by: Ray Cassick \(Home\) | last post by:
I am in a bit of a bind. I can't believe I cannot figure this out but I have been at it all day and it is just not coming to me. I am building menus on a form based upon an XML file. I have...
0
by: ssg31415926 | last post by:
I have a list view which contains various object types and I need to create a context menu with menu items dependent on the object type. I can detect the object type at MouseDown. I've written...
12
by: Steve_Black | last post by:
I posted a similar message earlier but we've geared away from the original topic somewhat so I thought I'd post again in hopes of getting input from others. I am creating a MenuStrip...
2
N002199B
by: N002199B | last post by:
Hie Guru's I am trying to write code that can be re-used by simple calls to build menus and submenus on mobile devices. I have heard about the cascading menus design pattern, but do not...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.