CONTOHNYA..!!!!
pada menu editor buatlah struktur menu seperti berikut
Letak | Capton | Name |
fonts | Fonts | Mnufonts |
…size | Size | Mnusize |
……8 | 8 | Mnu8 |
……14 | 14 | Mnu14 |
……18 | 18 | Mnu18 |
…….26 | 26 | Mnu26 |
....- | - | mnupisah |
….color | Color | Mnucolor |
……merah | Merah | Mnumerah |
…….hijau | Hijau | Mnuhijau |
…….biru | Biru | Mnubiru |
....- | - | Mnupisah2 |
…jenis | Jenis | Mnujenis |
……tahoma | Tahoma | Mnutahoma |
……stop | Stop | Mnustop |
Logikanya
Private Sub Command1_Click()
End ‘ mengakhiri program
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
PopupMenu mnufonts 'memanggil menu menjadi pop up menu
End If
End Sub
Private Sub mnu8_Click()
Label1.FontSize = 8 '
End Sub
Private Sub mnu18_Click()
Label1.FontSize = 18
End Sub
Private Sub mnu26_Click()
Label1.FontSize = 28
End Sub
Private Sub mnumerah_Click()
Label1.ForeColor = &HFF& ' warna merah
End Sub
Private Sub mnu14_Click()
Label1.Font = 14
End Sub
Private Sub mnuhijau_Click()
Label1.ForeColor = &H8000& ' warna hijau
End Sub
Private Sub mnubiru_Click()
Label1.ForeColor = &HFF0000 'warna biru
End Sub
Private Sub mnutahoma_Click()
Label1.FontName = "tahoma"
End Sub
Private Sub mnustop_Click()
Label1.FontName = "Stop"
End Sub