AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[solved]LisBox : how to detect a double click ?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Jeannot40



Joined: 19 Jul 2008
Posts: 4

PostPosted: Sun Jul 20, 2008 12:14 am    Post subject: [solved]LisBox : how to detect a double click ? Reply with quote

Hi all

I am trying to do a menu in a ListBox and i should that the items can be choosen by a double click; but i cannot detect the double click with my code :

Code:

#NoTrayIcon

#NoEnv 
SendMode Input 
SetWorkingDir %A_ScriptDir% 

items = menu1|menu2|menu3

   ;init window
   Gui, Font, S12 CDefault, Arial                       
   Gui, Add, Text, x6 y10 w250 h20, Choose an Application
   Gui, Add, ListBox, vChoice gDbleClick w500 h300 hscroll vscroll AltSubmit
   Gui, Add, Button, vSend gValideMenu x110 y340 w60 h21 +Default, &Send
   Gui, Add, Button, vCancel gGuiClose x260 y340 w60 h21, Cancel
   Gosub ShowMainWindow
 
   Escape::
        Gosub GuiClose
   return
   

ShowMainWindow:   
   GuiControl, , Choice, %items%
   Gui, Show,,   Mainmenu
return

DbleClick:
if %A_GuiEvent%="DoubleClick"
MsgBox %A_EventInfo%
return



ValideMenu:
      Gui, submit,                               
      GuiControlGet, Choice                     
      items = |appli1 menu%Choice%|appli2 menu%Choice%|appli3 menu%Choice%
     Gosub ShowMainWindow                         

return

GuiClose:
   Gui cancel
   GuiEscape:
   ExitApp


help me please; i'm beginner


Last edited by Jeannot40 on Sun Jul 20, 2008 2:15 am; edited 1 time in total
Back to top
View user's profile Send private message
Speedzter



Joined: 23 Jun 2008
Posts: 28

PostPosted: Sun Jul 20, 2008 12:28 am    Post subject: Reply with quote

Try This..

Change this:

Code:
DbleClick:
if %A_GuiEvent%="DoubleClick"
MsgBox %A_EventInfo%
return


To This:

Code:
DbleClick:                               
   IfNotEqual A_GuiControlEvent,DoubleClick
   Return
   Else
    MsgBox %A_EventInfo%
Return   
Back to top
View user's profile Send private message
Jeannot40



Joined: 19 Jul 2008
Posts: 4

PostPosted: Sun Jul 20, 2008 2:14 am    Post subject: Reply with quote

Thank you very much : this works perfectly.

But why my code doesn't work ? It's a mystery
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 5895

PostPosted: Sun Jul 20, 2008 2:33 am    Post subject: Reply with quote

Jeannot40 wrote:
But why my code doesn't work ? It's a mystery


Try this:

Code:
Var=Content

If ( Var = "Content" ) ; Correct
   MsgBox %Var%

If Var=Content         ; Correct
   MsgBox %Var%
   
If %Var%="Content"     ; Incorrect
   MsgBox %Var%


Smile
_________________
SKAN - Suresh Kumar A N
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group