|
-
Aug 14th, 2003, 01:16 AM
#1
Thread Starter
Member
Which submenu is clicked on?
Hello there...
I got a small problem.
I need to know which of the submenus the user clicks on.
It´s not hard if I wouldn´t need to create the submenu in the code.
I create the submenus in the code with the code that is shown under.
Anyone know how I can find which submenu that is clicked on?
I need to execute code if a submenu is clicked on.
Try
user = 'The name of the item that is clicked on
Catch
End Try
DG_Module.CaptionText = "User: " + user
Thanks for all help.
Private Sub Create_Usermenulist()
Dim rows, i As Integer
'Clears my user dataset
DS_User2.Clear()
'Updates the dataset
OleDbDataAdapter2.Fill(DS_User2)
'Clears the submenu from items
Menu_Users.MenuItems.Clear()
'Count the number of items that going to fit in the submenus
rows = DS_User2.User.Rows.Count
'Adding them
For i = 0 To rows - 1
'Declare a new one as a number (i)
Dim myMenuItem As New MenuItem(i)
'Adding one submenu with the name from the datagrid
Menu_Users.MenuItems.Add(DG_User.Item(i, 0))
Next
'Sets variabel....
Try
user = DG_User.Item(DG_User.CurrentRowIndex, 0)
Catch
End Try
DG_Module.CaptionText = "User: " + user
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|