Skip to main content

Write a VB Program to create a POPUP menu. Menu are Color (sub menu- red, green, blue, yellow), Font (Times New Roman, Verdana, Arial Black etc), Font Size (10, 11, 12 etc) after clicking on particular menu changes should reflect on Label control

· One min read
Kaustubh Kulkarni
file.vb
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)  
If Button AndvbRightButton Then
PopupMenumnuMenu
End If


End Sub

Private Sub mnuArial_Click()
Label1.FontName = "Arial Black"
End Sub

Private Sub mnuGreen_Click()
Label1.ForeColor = vbGreen
End Sub

Private Sub mnuRed_Click()
Label1.ForeColor = vbRed
End Sub

Private Sub mnuSize10_Click()
Label1.FontSize = 10
End Sub

Private Sub mnuSize12_Click()
Label1.FontSize = 12
End Sub

Private Sub mnuTNR_Click()
Label1.FontName = "Times New Roman"
End Sub

Private Sub mnuVer_Click()
Label1.FontName = "Verdana"
End Sub