Results 1 to 3 of 3

Thread: Pop-up Menu

  1. #1

    Thread Starter
    Addicted Member Cbomb's Avatar
    Join Date
    Jul 1999
    Posts
    153

    Post

    I've seen this posted before, but I can't find it. Here is what I need:

    1 You click a label.
    2 An checkable menu item pops up- "Always
    on top?"
    3 Then I need to be able to read the staus
    of that menu item.

    All I know how to do is to pop up the Menu. Will someone pleasee tell me how to build the menu in code and read the staus of it? Thanks in advance.

  2. #2
    Lively Member
    Join Date
    Nov 1999
    Posts
    98

    Post

    create an invisible menu on the form you want to have the menu pop up on called mnuPopUp. in the menu editor create mnuOnTop. put this code in the Form_MouseDown() sub:

    Code:
    'for right mouseclick
    if button = 2 then PopupMenu mnuPopUp
    'for left mouseclick
    if button = 1 then PopupMenu mnuPopUp
    for a really simple "Always on top" function check out my post at the bottom of this url:

    http://www.vb-world.net/ubb/Forum1/HTML/011286.html

    then use an if ... then statement for:
    if mnuOnTop = checked then YesOnTop Me

    hope this helps. good luck with all!!

    --michael

  3. #3
    Member
    Join Date
    Dec 1999
    Posts
    37

    Post

    In the Menu Editor, it should look like this one.
    PopUp
    ...Blue
    ...Green

    PopUp displays a pop-up Menu. When you click a label, pop-up menu appears. Here is the code you are looking for, but I could not answer for problem #3.

    Code:
    Private Sub Label1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Button = vbLeftButton Then
            Call PopupMenu(mnuPopUp)
        End If
    End Sub
    
    Private Sub mnuBlue_Click()
        Label1.BackColor = vbBlue
        mnuBlue.Checked = Not (mnuBlue.Checked)
    End Sub
    
    Private Sub mnuGreen_Click()
        Label1.BackColor = vbGreen
        mnuGreen.Checked = Not (mnuGreen.Checked)
    End Sub

    Hope this helps too.

    Ruchi

    [This message has been edited by Ruchi (edited 12-06-1999).]

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