473,473 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Menu items name

In VB.net menus, there is a name property, but it isnt
available in runtime..strange!!!

does someone has a idea how i can do something similar?

reason i want it is...in my app the UI text comes from a
language table in database. For form and control text i
retrieve it using the formname+control name. But doing the
same thing for menu is not possible. One idea is to store
the name of the menu item e.g. mnuFile in the text itself
and at runtime change the text by using the original text
of the menuitem. Drawback is, at runtime i cannot get the
UI text twice as now the control has lost its name.

Regards

Sachin
Nov 20 '05 #1
3 1329
"Sachin D." <in**@baroc.co.in> scripsit:
In VB.net menus, there is a name property, but it isnt
available in runtime..strange!!!

does someone has a idea how i can do something similar?

reason i want it is...in my app the UI text comes from a
language table in database. For form and control text i
retrieve it using the formname+control name. But doing the
same thing for menu is not possible. One idea is to store
the name of the menu item e.g. mnuFile in the text itself
and at runtime change the text by using the original text
of the menuitem. Drawback is, at runtime i cannot get the
UI text twice as now the control has lost its name.


<http://www.google.de/groups?as_q=author%3Aherfried%20menuitem%20name&ie =UTF-8>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Yust a suggestion.
..net offers a different sollution for multilangual forms, localizable forms.
using the localizable and language properties. you might want to explore
that option 2.
"Sachin D." <in**@baroc.co.in> wrote in message
news:0d****************************@phx.gbl...
In VB.net menus, there is a name property, but it isnt
available in runtime..strange!!!

does someone has a idea how i can do something similar?

reason i want it is...in my app the UI text comes from a
language table in database. For form and control text i
retrieve it using the formname+control name. But doing the
same thing for menu is not possible. One idea is to store
the name of the menu item e.g. mnuFile in the text itself
and at runtime change the text by using the original text
of the menuitem. Drawback is, at runtime i cannot get the
UI text twice as now the control has lost its name.

Regards

Sachin

Nov 20 '05 #3
Hi Sachin,

The code below might help you play with your menus - when you've explored
creating your own MenuItem class and looked into Localisation. ;-)

Regards,
Fergus

<code>
Public Module MenuStuff

Public Function GetMenuItems (F As Form) As ArrayList
Dim alMenuItems As New ArrayList
Dim oMainMenu As MainMenu = F.Menu

If oMainMenu Is Nothing OrElse _
oMainMenu.MenuItems Is Nothing Then _
Return alMenuItems

GetMenuItems (alMenuItems, oMainMenu.MenuItems)
Return alMenuItems
End Function

Private Sub GetMenuItems (alMenuItems As ArrayList, _
aoMenuItems As Menu.MenuItemCollection)
alMenuItems.AddRange (aoMenuItems)
Dim oMenuItem As MenuItem
For Each oMenuItem In aoMenuItems
GetMenuItems (alMenuItems, oMenuItem.MenuItems)
Next
End Sub
End Module

Sub DisplayMenus (F As Form)
Dim alMenuItems As ArrayList = GetMenuItems(F)
Dim oMenuItem As MenuItem
For Each oMenuItem In alMenuItems
Console.WriteLine (oMenuItem.Text)
Next
End Sub
</code>
Nov 20 '05 #4

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

Similar topics

13
by: elad | last post by:
Hi The Menu doesn't work properly when I have 2 frame and the Menu popup frame=document target frame, when I choose item in the menu the doc opened and the menu get stuck. Here is the code...
1
by: ajay | last post by:
I have following code for a slide menu but i twiked it to work for a single level menu. Open it in a Browser to get a clear picture. I have 2 Qs 1) How to make first entry as non-link. i.e i...
2
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at...
8
by: Dennis C. Drumm | last post by:
Is there a way to modify the standard context menu shown when someone right clicks in a windows text box and that would work for all open windows applications? The standard context menu for...
4
by: paula | 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...
2
by: jack | last post by:
Hello, I need to dynamically add menu items to an existing menu on an MDI form. In the form load, when I create the menu items then add it to the menu control using the Add method, the entire...
2
by: Ludwig | last post by:
My application has a main tool strip menu (File, Options, help,...). There are also a number of context menu's that popup. Some main menu items should also be available in some context menu's. ...
2
by: Ravi Joshi | last post by:
The menu on my site works fine in IE6 and Firefox. In IE7, there is a problem with the menu: when you mouse over the various main catagories, the sub-catagories all appear to the right as they...
1
by: Kayvine | last post by:
Hi guys, this is a question I have for an assignment, it is pretty long, but I am not asking for the code(well if someone wants to write I'll be really happy, lol), but I just want to know how to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.