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 

Label not executed

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



Joined: 27 Nov 2006
Posts: 52
Location: Heerlen Country: Netherlands

PostPosted: Sat Apr 19, 2008 12:04 pm    Post subject: Label not executed Reply with quote

i have to following code:
Code:
ShowEditor()
{
   global
   Gui, 4:+owner1
   Gui +Disabled
   IniRead, edAantal, %Inifile%, bus, aantal
   Counter=1
   Loop, %edAantal%
   {
      IniRead, Tabs, %Inifile%, bus, %Counter%
      edTabs = %edTabs%|%Tabs%
      Counter+=1
   }
   StringTrimLeft, edTabs, edTabs, 1
   Gui, 4:Add, Tab2, h250 w375, %edTabs%
   Counter=1
   Loop, %edAantal%
   {
      IniRead, Tabs, %Inifile%, bus, %Counter%
      Gui, 4:Tab, %Counter%
      StringReplace, Tabs, Tabs, %A_SPACE%, _, All
      StringReplace, Tabs, Tabs, (, , All
      StringReplace, Tabs, Tabs, ), , All
      StringReplace, Tabs, Tabs, ., , All
      Gui, 4:Add, ListBox, gActiefControl vLST%Tabs% w245 h175
      Gui, 4:Add, Button, w100 xp+252 gToevoegen, Toevoegen
      Gui, 4:Add, Button, w100 yp+35 gVerwijderen, Verwijderen
      Counter+=1
   }
   ;LV_Add om items toe te voegen
   Gui, 4:Tab
   Gui, 4:Add, Button, w100 x10 Default, OK
   Gui, 4:Show,, Bewerk INI
}
return

4ButtonOK:  ; This section is used by the "Editor box" above.
4GuiClose:
4GuiEscape:
   Gui, 1:-Disabled  ; Re-enable the main window (must be done prior to the next step).
   Gui Destroy  ; Destroy the Editor box.
return

Toevoegen:
gui +lastfound
MsgBox, %CurrentControl%
return

Verwijderen:
;
;
return

ActiefControl:
MsgBox, %A_GuiControl%
CurrentControl:=%A_GuiControl%
MsgBox, %CurrentControl%
return


As you can see, i have the following label defined and used in my code: ActiefControl
Now the problem is that when i click on the listbox, the label is NOT executed. how can i get the label to execute??
_________________
Before asking a question try to read the manual
Always use the code sections when you paste some code
Back to top
View user's profile Send private message
HugoV



Joined: 27 May 2007
Posts: 499

PostPosted: Sat Apr 19, 2008 12:52 pm    Post subject: Reply with quote

Look into A_GuiEvent or A_GuiControlEvent. Something like
Code:
if A_GuiControlEvent = DoubleClick
    Gosub ActiefControl
return
Back to top
View user's profile Send private message
eagle00789



Joined: 27 Nov 2006
Posts: 52
Location: Heerlen Country: Netherlands

PostPosted: Sat Apr 19, 2008 3:43 pm    Post subject: Reply with quote

and do you have any clue where i should put that code?? because i don't have a clue
_________________
Before asking a question try to read the manual
Always use the code sections when you paste some code
Back to top
View user's profile Send private message
John W



Joined: 09 Apr 2007
Posts: 169

PostPosted: Sat Apr 19, 2008 5:16 pm    Post subject: Reply with quote

! You should put functions at the end of scripts !
_________________
John
Inactive - Until AutoHotkey is available for Linux.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
HugoV



Joined: 27 May 2007
Posts: 499

PostPosted: Sun Apr 20, 2008 8:31 am    Post subject: Reply with quote

Are you sure your listbox has any data in it? The script below shows a listbox without data and clicking in the empty listbox nothing happens. If you uncomment the first line it works.
Code:
;startlist=1|2|3|4|5|6|7|8|9|10
Gui, 1:Add, ListBox, x5 y57 w197 h230 gActiveControl vChoice,%StartList%
Gui, 1:Show
Return

ActiveControl:
Gui, submit, NoHide
MsgBox, %A_GuiControl%
CurrentControl:=%A_GuiControl%
MsgBox, %CurrentControl%
Return
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