Results 1 to 4 of 4

Thread: checked menus

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    6

    Question

    i have no idea how to use the checked function on menus, the code is my major query, how do assign code to something if it is checked or not!

    thanks!

  2. #2
    Lively Member
    Join Date
    Mar 2000
    Posts
    81

    Question ???

    Eh?

    The Checked property is a Boolean value (True or False).
    Supposing your menu item is called mnuChecker:
    Code:
    mnuChecker.Checked = True     'when the tick is present
    mnuChecker.Checked = False    'when it isn't.
    To programatically check it yourself:
    Code:
    mnuChecker.Checked = True
    To toggle:
    Code:
    mnuChecker.Checked = Not mnuChecker.Checked
    Hope that helps, if not submit some more info (in English).

    Toot
    Some cause happiness wherever they go; others, whenever they go.

  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    Here's an example
    Code:
        Select Case mnuMyMenu.Checked
            Case True
                mnuMyMenu.Checked = False
                ' Do something (or nothing) based on the fact that it's not checked
            Case False
                mnuMyMenu.Checked = True
                ' Do somthing because it's checked
        End Select

  4. #4
    Guest
    Code:
    If mnumymenu.checked = True Then
    Msgbox "The menu is checked."
    Else
    Msgbox "The menu is not checked."
    End If
    This is just to tell you if the menu is checked. It is useful for having options in a program.

    And if you want someone to click the menu and want it to be checked or unchecked:

    Code:
    If mnumymenu.Checked = True Then 'If checked=True Then
    mnumymenu.Checked = False 'checked=False
    'do what you want if it is unchecked
    ElseIf mnumymenu.Checked = False Then 'If checked=False Then
    mnumymenu.Checked = True 'checked=True
    'do what you want if it is checked
    End If

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