| View previous topic :: View next topic |
| Author |
Message |
brahk
Joined: 22 Mar 2009 Posts: 15
|
Posted: Mon Mar 30, 2009 9:03 pm Post subject: How can I detect that a listbox item was "double clicke |
|
|
Does anyone have a simple example of a small list box where a double click is used to select an item?
I am new to AHK and have not been able to figure this out via multiple attempts.
Thanks,
Brad |
|
| Back to top |
|
 |
aCkRiTe
Joined: 21 Jul 2006 Posts: 555
|
Posted: Mon Mar 30, 2009 9:10 pm Post subject: |
|
|
Here is an example that might help you, but its just a single click, not double.
| Code: |
Gui, Add, ListBox, vColorChoice gSubroutine, Red|Green|Blue|Black|White
Gui, Show
Return
Subroutine:
Gui, Submit, NoHide
MsgBox, %ColorChoice%
Return
|
_________________
HTH...
|
|
| Back to top |
|
 |
soccer18soccer18
Joined: 18 Nov 2008 Posts: 101
|
Posted: Mon Mar 30, 2009 9:26 pm Post subject: |
|
|
Gui, Add, ListBox, vColorChoice gSubroutine, Red|Green|Blue|Black|White
Gui, Show
Return
Subroutine:
if A_GuiEvent = DoubleClick
LV_GetText(RowText, A_EventInfo)
msgbox, %RowText%
return |
|
| Back to top |
|
 |
brahk
Joined: 22 Mar 2009 Posts: 15
|
Posted: Mon Mar 30, 2009 9:28 pm Post subject: |
|
|
Thank You VERY much for the quick reply.
Now that I see your example, it all makes sense!
Brad |
|
| Back to top |
|
 |
Lighthouse
Joined: 12 Jan 2009 Posts: 55 Location: Southern Ca, USA
|
Posted: Mon Mar 30, 2009 9:29 pm Post subject: |
|
|
Don't forget the brackets.
| Code: | Gui, Add, ListBox, vColorChoice gSubroutine, Red|Green|Blue|Black|White
Gui, Show
Return
Subroutine:
if A_GuiEvent = DoubleClick
{
LV_GetText(RowText, A_EventInfo)
msgbox, %RowText%
}
return
|
|
|
| Back to top |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 3113 Location: MN, USA
|
Posted: Mon Mar 30, 2009 9:52 pm Post subject: |
|
|
The LV_ functions are only for ListView controls, not ListBoxes or anything else. | Code: | Gui, Add, ListBox, vColorChoice gSubroutine, Red|Green|Blue|Black|White
Gui, Show
Return
Subroutine:
if A_GuiEvent = DoubleClick
{
Gui, Submit, NoHide
msgbox, %ColorChoice%
}
return |
|
|
| Back to top |
|
 |
Lighthouse
Joined: 12 Jan 2009 Posts: 55 Location: Southern Ca, USA
|
Posted: Mon Mar 30, 2009 10:25 pm Post subject: |
|
|
Good to know  |
|
| Back to top |
|
 |
|