Menu: code
- We konden niet Alt+F4 als functietoets toekennen, maar het werkt wel, dus we mogen het
wel tonen.
Private Sub Form_Load()
mnuFileQuit.Caption = "&Afsluiten" & Chr(9) & "Alt+F4"
End Sub
- Het contextueel menu oproepen
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X
As Single, Y As Single)
If Button = 2 Then PopupMenu mnuContext
End Sub
- Dit zijn de andere vmenu's
Private Sub mnuContextInfo_Click()
'geen functietoets voor contextueel menu
MsgBox "Info", vbInformation
End Sub
Private Sub mnuFileNew_Click()
Dim f As New Form1
Load f
f.Show
End Sub
Private Sub mnuFileQuit_Click()
Unload Me
End Sub
Private Sub mnuVariaEngels_Click()
mnuFile.Caption = "&File"
mnuFileNew.Caption = "&New"
mnuFileQuit.Caption = "&Quit" & Chr(9) & "Alt+F4"
mnuVaria.Caption = "&Other"
mnuVariaEngels.Caption = "&English"
mnuVariaNederlands.Caption = "&Dutch"
mnuVariaWillekNaam.Caption = "An&other name"
End Sub
Private Sub mnuVariaNederlands_Click()
mnuFile.Caption = "&Bestand"
mnuFileNew.Caption = "&Nieuw"
mnuFileQuit.Caption = "&Verlaat" & Chr(9) & "Alt+F4"
mnuVaria.Caption = "&Varia"
mnuVariaEngels.Caption = "&Engels"
mnuVariaNederlands.Caption = "&Nederlands"
mnuVariaWillekNaam.Caption = "Willekeurige naam"
End Sub
Private Sub mnuVariaWillekNaam_Click()
Dim buffer As String
Do
buffer = InputBox("Geef een naam voor «Varia»")
Loop While buffer = ""
mnuVaria.Caption = buffer
End Sub
[VB Web] - [hlrnet] - [copyright]