ISN AutoIT Studio - creating new form
ISN AutoIT Studio - creating new form
I created .isf form file in ISN studio. In my main.au3 file I have included this form (#include "Formsmain.isf"). But when i hit run nothing happens. Do I have to add somenthing in my main.au3? (I'm pretty new with AutoIT)
Also when I look into code which form generates there is:
$btn1 = GUICtrlCreateButton("Button",170,70,100,30,-1,-1)
GUICtrlSetOnEvent(-1,"onBtn1Click")
shloudn't be there $btn1 instead of -1 in the second line?
Thanks :)
2 Answers
2
You need to make it a user defined function (UDF). That won't work because a UDF needs to be a .au3 file. I'm not familiar with ISN studio, however to include a UDF you need to do this.
.au3
#include "C:pathmyfunctions.au3"
Also if the UDF is in the same location as the script you can just use the relative path like this.
#include "myfunctions.au3"
Here is are some example UDF's.
http://www.autoitscript.com/wiki/User_Defined_Functions
See if there is an export or a way to save as au3. Typically you want to use one script for the GUI. then you can use other UDFs as additional code if you need it. you can also put the functions in the same script. So yes it can be all one big file
– Panama Jack
Jan 31 '14 at 14:08
You have done nothing wrong; just forgot something.
It's correct to include the .isf file in your script. So the GUI is already present, just hidden! You only need to show it using: GuiSetState(@SW_SHOW, $HANDLE_OF_YOUR_GUI).
.isf
GuiSetState(@SW_SHOW, $HANDLE_OF_YOUR_GUI)
Then you should see your GUI! As an example see the "Testproject" in ISN AutoIt Studio.
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
"-1" denotes the last GUI control that has been created in the script.
– mrt
Jan 31 '14 at 8:32