Jump to content

Scripting Query Gui's


Recommended Posts

Hi Guys/Gals,

Just starting out in AutoIt so I am still trying to get my bearings. How do I get the program to close just the $form2 box when I click the red 'X' rather than the whole program.

#include <GUIConstants.au3>

#include <GuiButton.au3>

$Form1 = GUICreate("Testing", 930, 524, 44, 81)

$Button1 = GUICtrlCreateButton("Next Form", 608, 440, 161, 41, 0)

GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")

GUISetState()

While 1

$Msg = GUIGetMsg()

Switch $Msg

if _ispressed ("0D") Then

$msg = $button1

endIf

Case $Button1

$Form2 = GUICreate("Troubleshooting Instructions", 800, 500)

$iMemo = GUICtrlCreateEdit("", 4, 35, 592, 428)

GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")

GUISetState()

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

Cheers

Ps Also I do close a forum topic I've searched around, but I can't find the button anywhere. Maybe I am suffering from ID 10 T syndrome. LOL

Frequent sufferer of ID10T Syndrome and CRAFT (Can't Remember A "BLEEP" Thing)
Link to comment
Share on other sites

Hi Guys/Gals,

Just starting out in AutoIt so I am still trying to get my bearings. How do I get the program to close just the $form2 box when I click the red 'X' rather than the whole program.

#include <GUIConstants.au3>

#include <GuiButton.au3>

$Form1 = GUICreate("Testing", 930, 524, 44, 81)

$Button1 = GUICtrlCreateButton("Next Form", 608, 440, 161, 41, 0)

GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")

GUISetState()

While 1

$Msg = GUIGetMsg()

Switch $Msg

if _ispressed ("0D") Then

$msg = $button1

endIf

Case $Button1

$Form2 = GUICreate("Troubleshooting Instructions", 800, 500)

$iMemo = GUICtrlCreateEdit("", 4, 35, 592, 428)

GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")

GUISetState()

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

Cheers

Ps Also I do close a forum topic I've searched around, but I can't find the button anywhere. Maybe I am suffering from ID 10 T syndrome. LOL

Lol nice one. Just change your

Case $GUI_EVENT_CLOSE
exit

to

Case $GUI_EVENT_CLOSE
GuiSetState(@SW_HIDE,$form2)
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...