Results 1 to 2 of 2

Thread: Which submenu is clicked on?

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    62

    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
    //Martin Andersson

  2. #2

    Thread Starter
    Member
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    62
    I found how to trigger a function
    But I need to know how to find out which of the rows that is triggered of the submenus
    Here is my header of te function that is running. (if it helps)

    Private Sub Menu_Users_Selected_Row_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Menu_Edit_User.Click
    //Martin Andersson

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width