Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Menu Bar checkmarks

Status
Not open for further replies.

mbrink

Technical User
Jul 5, 2002
13
US
I've found how to make a checked menu item and it changes the variable the way I want, but I can't get clicking on that menu item to toggle the checkmark. It either always has the check, or always doesn't. I need code to change that property on runtime.

If it helps, the item I want to have the checkmark abilities is called mnuSound, and is under mnuOptions. And this is VB6.0.

Michael
 
Try this

Private Sub mnuSound_Click()
mnuSound.Checked = Not mnuSound.Checked
End Sub
If you choose to battle wits with the witless be prepared to lose.
[machinegun][hammer]

[cheers]
 
That didn't work. Comes up with a 'object or data member not found' error. When I type the "mnuSound.", the four options that pop up are Count, Item, LBound, and Ubound.

If I use mnusound.item, the option for checked shows up, but if I use it, it highlights item and gives a 'argument not optional' error.

Help again?

Michael
 
Yoiu have the index property set in your menu. This sets up an array of menu items. Look in Menu editor at the Index box.

To refer to the individual menu items use:
Private Sub mnuSound_Click(Index As Integer)
mnuSound(index).Checked = Not mnuSound(index).Checked
End Sub Let me know if this helps
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top