Jump to content

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)

CreateLabel()

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

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

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...