|
-
Jan 15th, 2004, 10:05 AM
#1
Thread Starter
Addicted Member
Favorite Menu Problem
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?
-
Jan 15th, 2004, 11:00 AM
#2
you mistyped...
thename = menu.favlistmenu(index).Caption
-
Jan 15th, 2004, 11:21 AM
#3
Put:
At the top of your form and then try and run your code.
This will tell you if you've mistyped any varibles incorrectly.
Wooof
-
Jan 15th, 2004, 12:30 PM
#4
Thread Starter
Addicted Member
ty
dur fiqures my mistake. Thought i could be used in replace of index. works perfect now 
thanks guys.
-
Jan 15th, 2004, 02:55 PM
#5
Supreme User
Originally posted by Wokawidget
Put:
At the top of your form and then try and run your code.
This will tell you if you've mistyped any varibles incorrectly.
Wooof
Theres a thing in the VB Options that places this at the top of every code window automatically for you, forgot what it was called though
-
Jan 15th, 2004, 02:59 PM
#6
Originally posted by Madboy
forgot what it was called though
Menu: Tool | Options | Editor and check the Require Variable Declaration.
Bruce.
-
Jan 15th, 2004, 03:05 PM
#7
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
|