Code: Select all
Gui, Add, Listbox, x50 y50 gGuiContextMenu, This is Row 1|This is Row 2|This is Row 3
Gui, Show, h200 w200
return
guiclose:
exitapp
GuiContextMenu:
if A_GuiEvent = RightClick
{
msgbox, %A_EventInfo%
}
return
Code: Select all
Gui, Add, Listbox, x50 y50 gGuiContextMenu, This is Row 1|This is Row 2|This is Row 3
Gui, Show, h200 w200
return
guiclose:
exitapp
GuiContextMenu:
if A_GuiEvent = RightClick
{
msgbox, %A_EventInfo%
}
return
Code: Select all
Gui, Add, Listbox, x50 y50 gGuiContextMenu, This is Row 1|This is Row 2|This is Row 3
Gui, Show, h200 w200
return
guiclose:
exitapp
GuiContextMenu:
Gui, Submit, NoHide
if A_GuiEvent = RightClick
{
ControlGet, TextVar, Choice,, %focusvar%
msgbox, you right-clicked on %textvar%
}
return
Code: Select all
#NoEnv
Gui, Add, Listbox, x50 y50 w300 vMyList, This is Row 1|This is Row 2|This is Row 3 ; gGuiContextMenu <--- will be called automatically for a right-click
Gui, Show, , ListBox Test
Return
GuiClose:
ExitApp
GuiContextMenu:
If (A_GuiControl = "MyList") && (A_GuiEvent = "RightCLick")
{
GuiControlGet, MyList
MsgBox, 0, MyList, Currently selected item: %MyList%
}
Return
Users browsing this forum: Chunjee, haomingchen1998 and 130 guests