Code help for Menu, pop up menu

If Button = vbRightButton Then PopupMenu Me.mnuPopup




Private txtName_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As
Single)

If Button=vbRightButton Then

PopupMenu mnuEdit

End If

End Sub



How do I find out what menu item was clicked

str = popMenu.Name
Select Case str
Case "mCut"
MsgBox "cut"
Case "mPaste"
MsgBox "paste"
Case "mProperties"
MsgBox "pro"

End Select



Popup 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
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 Sub

Code 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 Sub




MsgBox "Code for 'Print' goes here.", vbInformation, "Menu Demo"



      Private Sub mnuBold_Click()
      If mnuBold.Checked Then
      lblTestText.FontBold = False
      mnuBold.Checked = False
Else
lblTestText.FontBold = True
mnuBold.Checked = True
End If
End Sub

More Related Content

PPT
Control flow in c
PDF
I keep getting a BC30389 'System.Currency' is not accessible in this context ...
PPT
Vb basics
PPT
File handling
PDF
Visual basic menu
PPT
Visual Basic menu
PPTX
Filehandling
DOC
Report on telnet
Control flow in c
I keep getting a BC30389 'System.Currency' is not accessible in this context ...
Vb basics
File handling
Visual basic menu
Visual Basic menu
Filehandling
Report on telnet

Viewers also liked (14)

PPT
VB Codes
PPTX
Standard Algorithms
DOC
PDF
The Best Source Code VB
PDF
TELNET Protocol
PDF
Visual Basic 6.0
PPT
Presentation on telnet
PPS
Ip address
PPT
Introduction to visual basic programming
PPT
Ip address and subnetting
PPT
TCP/IP Network ppt
PPTX
Internet protocol (ip) ppt
PPT
Visual basic ppt for tutorials computer
PPT
Visual Basic Codes And Screen Designs
VB Codes
Standard Algorithms
The Best Source Code VB
TELNET Protocol
Visual Basic 6.0
Presentation on telnet
Ip address
Introduction to visual basic programming
Ip address and subnetting
TCP/IP Network ppt
Internet protocol (ip) ppt
Visual basic ppt for tutorials computer
Visual Basic Codes And Screen Designs
Ad

Similar to Menu vb (20)

PDF
Deepika Mittal , BCA Third Year
PPTX
Menu stripe
PPTX
Menu pop up menu mdi form and playing audio in vb
PPTX
Module iii part i
PDF
Sachin Foujdar , BCA Third Year
PDF
Rakesh Bijawat , BCA Third Year
PDF
Kirti Kumawat, BCA Third Year
DOCX
Clase 2
PDF
Reshma Kodwani , BCA Third Year
DOCX
Vbreport program
PPTX
Colegio municipal
DOC
Macros
PDF
Sistema de ventas
PDF
Sistemadeventas 100707084319-phpapp01
PPT
VBA for technical writers
DOCX
Código Editor Net
PDF
Sudarshan Joshi , BCA Third Year
DOCX
Burger doll order form
PDF
Bhanu Pratap Singh Shekhawat, BCA Third Year
Deepika Mittal , BCA Third Year
Menu stripe
Menu pop up menu mdi form and playing audio in vb
Module iii part i
Sachin Foujdar , BCA Third Year
Rakesh Bijawat , BCA Third Year
Kirti Kumawat, BCA Third Year
Clase 2
Reshma Kodwani , BCA Third Year
Vbreport program
Colegio municipal
Macros
Sistema de ventas
Sistemadeventas 100707084319-phpapp01
VBA for technical writers
Código Editor Net
Sudarshan Joshi , BCA Third Year
Burger doll order form
Bhanu Pratap Singh Shekhawat, BCA Third Year
Ad

More from Amandeep Kaur (20)

PPTX
Video/ Graphics cards
PPT
Active x control
PPTX
Image contro, and format functions in vb
PPTX
Data base connectivity and flex grid in vb
PPTX
Toolbar, statusbar, coolbar in vb
PPTX
Richtextbox
PPTX
Treeview listview
PPTX
Progress bar
DOC
PPT
Ppt of socket
PPT
Introduction to computer graphics
PPT
Introduction to computer graphics
PPT
Introduction to computer graphics
PPT
Internet
DOCX
Internet working
DOC
Report on browser war
DOC
Report of internet connections
DOCX
Report on intranet
DOC
How to configure dns server(2)
DOC
Report on e commerce
Video/ Graphics cards
Active x control
Image contro, and format functions in vb
Data base connectivity and flex grid in vb
Toolbar, statusbar, coolbar in vb
Richtextbox
Treeview listview
Progress bar
Ppt of socket
Introduction to computer graphics
Introduction to computer graphics
Introduction to computer graphics
Internet
Internet working
Report on browser war
Report of internet connections
Report on intranet
How to configure dns server(2)
Report on e commerce

Menu vb

  • 1. Code help for Menu, pop up menu If Button = vbRightButton Then PopupMenu Me.mnuPopup Private txtName_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button=vbRightButton Then PopupMenu mnuEdit End If End Sub How do I find out what menu item was clicked str = popMenu.Name Select Case str Case "mCut" MsgBox "cut" Case "mPaste" MsgBox "paste" Case "mProperties" MsgBox "pro" End Select Popup 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. 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 Sub Code 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 Sub MsgBox "Code for 'Print' goes here.", vbInformation, "Menu Demo" Private Sub mnuBold_Click() If mnuBold.Checked Then lblTestText.FontBold = False mnuBold.Checked = False