Click to See Complete Forum and Search --> : Pop-up Menu
Cbomb
Dec 5th, 1999, 01:32 AM
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.
funkheads
Dec 5th, 1999, 01:59 AM
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:
'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
Ruchi
Dec 5th, 1999, 11:18 AM
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.
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).]
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.