Jump to content

Button in a child window. (Help a tyro).


lucius
 Share

Recommended Posts

Func MyFunc()

$chl = GUICreate("Title", 350, 100, $mwp[0]+50, $mwp[1]+10, -1, -1, $mainwin)

GUISetState(@SW_SHOW)

$file = GUICtrlCreateInput("File_name", 20, 20)

$n = GUICtrlCreateCombo("10", 250, 20, 50)

$btn = GUICtrlCreateButton("OK", 150, 50)

$msg = GUIGetMsg()

If $msg = $btn then MsgBox(0, "Test", "Test message")

EndFunc

This is the function building a child window. All the items are displayed well. But the button doesn't work properly. Tell me please what I did wrong.

I also tried to use GUIGetMsg(1) and then $msg[0] in all possible combinations, but it didn't help.

Link to comment
Share on other sites

Func MyFunc()

$chl = GUICreate("Title", 350, 100, $mwp[0]+50, $mwp[1]+10, -1, -1, $mainwin)

GUISetState(@SW_SHOW)

$file = GUICtrlCreateInput("File_name", 20, 20)

$n = GUICtrlCreateCombo("10", 250, 20, 50)

$btn = GUICtrlCreateButton("OK", 150, 50)

$msg = GUIGetMsg()

If $msg = $btn then MsgBox(0, "Test", "Test message")

EndFunc

This is the function building a child window. All the items are displayed well. But the button doesn't work properly. Tell me please what I did wrong.

I also tried to use GUIGetMsg(1) and then $msg[0] in all possible combinations, but it didn't help.

your controls overlap

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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