473,406 Members | 2,352 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,406 software developers and data experts.

Dropdown Form menu. How to find the tree that the sselected item is from

Hi There..

I have a Windows App with a menu. The menu is dynamically created at
runtime. This is working perfectly, except.....

I have serveral menus under the one parent. Under each of these menus,
there could be menu items with the same text. Of course, when I click
the menu item that I want I get the selected text returned to me. Ok..
this is fine, but if the actual menu item I select is not the first
one with the same text, how do I know the exact one I selected?

example:

Reports
|
--- Dec-03
| |-> Report 1
| |-> Report 2
|
--- Jan 04
|-> Report 1
|-> Report 2

So in the above example, if I/user selects Report 2 of Jan 04, the
select text that is return is "Report 2". How do I find out if that is
belonging to Dec 03 or Jan 04? The selected text is used to match the
Database to find the report to run, but in the above example, I always
get the DEC 03 Report 2. It would be good if I could find the
childmenu name (DEC 03 or JAN 04) as well...

This is the statement I use to get the selected item

Public Sub MenuClick(ByVal sender As Object, ByVal e As EventArgs)
Dim sSelected as string = CType(sender, MenuItem).Text()

........Blah Blah Blah

End Sub

Any ideas, code examples..

Thanks,
Robert
Nov 20 '05 #1
2 1500
Cor
Hi Robert,

Try what this very simple and logical sentence can do for you

Dim myItem As String = _
DirectCast(DirectCast(DirectCast(sender, MenuItem).Parent, Menu),
MenuItem).Text

:-))

Cor
Nov 20 '05 #2
Cor
Hi Robert,

Try what this very simple and logical sentence can do for you

Dim myItem As String = _
DirectCast(DirectCast(DirectCast(sender, MenuItem).Parent, Menu),
MenuItem).Text

:-))

Cor
Nov 20 '05 #3

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

Similar topics

1
by: djharrison | last post by:
I'm new to ASP and database programming but I am trying to connect to a database using a concatenation of a strings and a menu item from a form. Ok here's what I have... an asp form that has a...
1
by: Dennis M. Marks | last post by:
Is there a javascript alternative to the dropdown menu in a form (SELECT OPTION). I would like the ability to pass a selected item to a function but I would like more control in the design of the...
1
by: A-PK | last post by:
Hi, How could I set the presence of the form to be called to be locked inside the boundary of the calling form ? I got A and B form A form contain tree view menu and B form was part of the...
2
by: Joachim Bauer | last post by:
I'm using the code below to display a menu that opens when the mouse goes over the main menu item (try it in your browser to understand the behaviour). It uses "position:absolute" and a switch...
4
by: Ian Davies | last post by:
Hello I have two drop down menus in my php script. The items displayed in the second is dependent on which item is choosen from the first i.e. the choosen item from the first filters the items in...
0
by: Robert Brown | last post by:
Hi There.. I have a Windows App with a menu. The menu is dynamically created at runtime. This is working perfectly, except..... I have serveral menus under the one parent. Under each of these...
1
by: Dino Buljubasic | last post by:
Hi, I have a toolbar with several buttons on it, one of which is set up to be as a DropDown button. I also have a context menu with menu items assigend to it so when I click that button, my...
1
by: Curtis | last post by:
Somehow I'm just missing something. I don't know how to catch when a user clicks on an item in a dropdown list for a dropdown style button on a toolbar. I create a new app. Form1. Add a...
2
by: Ian Davies | last post by:
Hello Ive been informed that I need to do the following in javascript. I have two drop down menus in my php script. The items displayed in the second is dependent on which item is choosen from the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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,...

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.