Jump to content
Sign in to follow this  

Not creating a control on the right GUI window

Recommended Posts


I have 2 GUI windows, the main one and an options one. However, once the script begins, the script adds a control to the gui (And adds controls to the GUI alot afterwards), but instead of adding it to the main GUI, it adds the control to the options GUI.

;Simple example
$Mainwindow = GUICreate("Test", -1, -1, 500, 500)
$Optionswindow = GUICreate("Options Test", -1, -1, 350, 350)
GUISetState(@SW_Show, $MainWindow)
GUISetState(@SW_Hide, $OptionsWindow)


While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3

Func CreateLabel()
GUICtrlCreateLabel("Test", 20, 20, 20, 20)

Notice how it places it on the Options window. Now a good solution to this would be create the options window first, but since I use the function alot, if I open the options window the function will not work anymore.

Share this post

Link to post
Share on other sites

I think GUISwitch() would solve your problem

I ran. I ran until my muscles burned and my veins pumped battery acid. Then I ran some more.

Share this post

Link to post
Share on other sites

I was not aware that this function existed! hah, thanks.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.