Search code examples
user-interfaceautoit

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 "Forms\main.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 :)


Solution

  • 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.

    #include "C:\path\myfunctions.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