Menu vb

1,428 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,428
On SlideShare
0
From Embeds
0
Number of Embeds
135
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Menu vb

  1. 1. Code help for Menu, pop up menuIf Button = vbRightButton Then PopupMenu Me.mnuPopupPrivate txtName_MouseUp(Button As Integer, Shift As Integer, X As Single, Y AsSingle)If Button=vbRightButton ThenPopupMenu mnuEditEnd IfEnd SubHow do I find out what menu item was clickedstr = popMenu.NameSelect Case strCase "mCut"MsgBox "cut"Case "mPaste"MsgBox "paste"Case "mProperties"MsgBox "pro"End SelectPopup menu coding Private Sub lblTestText_MouseDown(Button As Integer, _ Shift As Integer, _ X As Single, _ Y As Single) If Button = vbRightButton Then PopupMenu mnuPopUpFormat, vbPopupMenuRightButton End If End Sub
  2. 2. Code for bold Private Sub mnuBold_Click() If mnuBold.Checked Then lblTestText.FontBold = False mnuBold.Checked = False Else lblTestText.FontBold = True mnuBold.Checked = True End If End SubCode the mnuItalic_Click and mnuUnderline_Click events in a similar fashion as shown below. Private Sub mnuItalic_Click() If mnuItalic.Checked Then lblTestText.FontItalic = False mnuItalic.Checked = False Else lblTestText.FontItalic = True mnuItalic.Checked = True End If End Sub Private Sub mnuUnderline_Click() If mnuUnderline.Checked Then lblTestText.FontUnderline = False mnuUnderline.Checked = False Else lblTestText.FontUnderline = True mnuUnderline.Checked = True End If End SubMsgBox "Code for Print goes here.", vbInformation, "Menu Demo" Private Sub mnuBold_Click() If mnuBold.Checked Then lblTestText.FontBold = False mnuBold.Checked = False
  3. 3. ElselblTestText.FontBold = TruemnuBold.Checked = TrueEnd IfEnd Sub

×