Ok ive coded an intire working editable favorite menu for my software now the problem im having is with the menu index im not quite sure how to get the menu index of which favorite was clicked on the menu.

Private Sub favlistmenu_Click(Index As Integer)

Dim thename As String
Dim thefav As String


thename = menu.favlistmenu(i).Caption
thefav = ReadInI(thename, "address", "C:\Program Files\newproduct\favorites.ini")

MsgBox thename
MsgBox thefav

End Sub

thats my code and the problem is no matter what it keeps making thename the first one on the menu list instead of the one that was clicked how do i fix this problem anyone please?