473,771 Members | 2,297 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Menu items name

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

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+contro l 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 1344
"Sachin D." <in**@baroc.co. in> scripsit:
In VB.net menus, there is a name property, but it isnt
available in runtime..strang e!!!

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+contro l 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=aut hor%3Aherfried% 20menuitem%20na me&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..strang e!!!

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+contro l 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.MenuI tems Is Nothing Then _
Return alMenuItems

GetMenuItems (alMenuItems, oMainMenu.MenuI tems)
Return alMenuItems
End Function

Private Sub GetMenuItems (alMenuItems As ArrayList, _
aoMenuItems As Menu.MenuItemCo llection)
alMenuItems.Add Range (aoMenuItems)
Dim oMenuItem As MenuItem
For Each oMenuItem In aoMenuItems
GetMenuItems (alMenuItems, oMenuItem.MenuI tems)
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.WriteLi ne (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
5030
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 I'm using: FrameSet ------------------------------------------------------- <html>
1
4332
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 want to make first text as Table Heading/menu category. For examle in the given menu i want to make a heading as "Comp. Languages" which won't be a link. 2) The position of this menu is absolute to the page. I want to make it absolute to the Table...
2
3895
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 http://home.pacific.net.sg/~jacksony ? (the drop down bar could not work at www.apchosting.net but can drop at home.pacific.net.sg. I suspect it is a server problem but was told it is not possible, therefore assuming it is a client script problem? the script works last time...
8
10101
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 a text box has 6 items, undo, cut, copy, paste, delete and select all. I would like to add one additional paste menu that opens a new sub menu with several optional text items that could be pasted. The items would be populated by my program but...
4
4002
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 looking for. i am looking for code to make a dynamical menu with submenus The menu items are stored in a MS SQL Table and when by loading the page the items will be created. i have made a asp table. i want my menu on the left cell, in the middle...
2
2313
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 menu dissappears. Any one know why? Below is the code I'm using to create the menu items and append them to the existing menu: Dim aDatasheets As ArrayList = gOSSystemFile.Datasheets
2
9785
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. Is there a way of defining these shared menu items once, and merge them in the main menu and context menu. I don't want to create the same menu's and handling the same event handlers. What approach is there for sharing menu items, so that there...
2
2285
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 should; however, as soon as you mouse towards any but the TOP sub-catagory, all those sub-catagories still view there. It will work first time quite fine..but if user clicks outsite anywhere in screen then this problem occur.. i think it's css...
1
2518
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 start it and what main topics in C I will need to cover in the assignment. Thanks a lot. CSC180 Assignment #3: Menu Madness Due Date: Thursday, November 8th at 1:00am Contents: · General Info · What to Hand In o Submission Instructions
0
10260
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10102
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9910
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.