D
David Webb
Hi,
In VB.NET CF, I have a menu called mnuAction. I read a table in a
database and retrieve values, for which I add a menu sub item. E.g. If
I read 3 items, I add 3 submenus. I loop through the Data Reader as
follows :-
Do While sqlDR.Read
ReDim Preserve mnu(iMnuCount)
mnu(iMnuCount) = New MenuItem
mnu(iMnuCount).Text = cDatabase.RetrieveCurrentStatus(2,
CType(sqlDR(0), Long)).ToUpper
frmJobDetails.mnuAction.MenuItems.Add(mnu(iMnuCount))
iMnuCount += 1
Loop
My problem being, is that I need to perform different functions based
on which menu item the user clicks. If the user clicks menuItem(1), I
need to access a function to display a screen. I never know if there
will be 1 or 10 menus. I tried coding a function in mnuAction_Click
but I don't understand the properties. Can anyone explain how I can
put a function in to at least tell me which menu I am in when I click
it? From there, I will be able to work out which function I need to
use.
I hope the about makes sense - I know what I mean, I'm just having
difficulty putting it into words!
Regards,
David.
In VB.NET CF, I have a menu called mnuAction. I read a table in a
database and retrieve values, for which I add a menu sub item. E.g. If
I read 3 items, I add 3 submenus. I loop through the Data Reader as
follows :-
Do While sqlDR.Read
ReDim Preserve mnu(iMnuCount)
mnu(iMnuCount) = New MenuItem
mnu(iMnuCount).Text = cDatabase.RetrieveCurrentStatus(2,
CType(sqlDR(0), Long)).ToUpper
frmJobDetails.mnuAction.MenuItems.Add(mnu(iMnuCount))
iMnuCount += 1
Loop
My problem being, is that I need to perform different functions based
on which menu item the user clicks. If the user clicks menuItem(1), I
need to access a function to display a screen. I never know if there
will be 1 or 10 menus. I tried coding a function in mnuAction_Click
but I don't understand the properties. Can anyone explain how I can
put a function in to at least tell me which menu I am in when I click
it? From there, I will be able to work out which function I need to
use.
I hope the about makes sense - I know what I mean, I'm just having
difficulty putting it into words!
Regards,
David.