Seite 1 von 1

Unable to use my own variables in the gui editor

Verfasst: Mi 26. Jan 2022, 13:11
von HenrikR
Hi

I have some info which I have defined in Autoit as a variable, in this case it is just $DateTime which contains the date and time, i can enter this line $DateTimeOnForm = GUICtrlCreateLabel($DateTime, 310, 20, 300, 25) and it will display the variable instead of the normal text entry. But I cannot do this in formstudio. I tried to import the gui from autoit, isf then changes the var name to "DateTime" as seen her $DateTimeLabel = GUICtrlCreateLabel("DateTime",343,20,143,25,BitOr($SS_LEFT,$SS_NOTIFY),-1)

Am I trying to do something that the formstudio cannot do or is there a workaround?

Regards
Henrik

Re: Unable to use my own variables in the gui editor

Verfasst: Fr 28. Jan 2022, 18:54
von ISI360
Hi

You can do this: You simply need to select "text from func" to your label in the formstudio and it should work.
"Text from func" tells the formstudio that the Data is not a String but a return of a func (or a direct variable).
You need to enter the var with the "$"-char: $DateTime
Then it should work as you expect.

Re: Unable to use my own variables in the gui editor

Verfasst: Mi 2. Feb 2022, 10:19
von HenrikR
Ahh, great.
That worked.

Thanks for the help.

Regards
/HenrikR

Re: Unable to use my own variables in the gui editor

Verfasst: Mi 2. Feb 2022, 11:33
von ISI360
Glad to hear it worked ;)