Sign in to follow this  
Followers 0
ausssieautomate

Scripting Query Gui's

3 posts in this topic

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)

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

Cheers mate it's working now.


Frequent sufferer of ID10T Syndrome and CRAFT (Can't Remember A "BLEEP" Thing)

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  
Followers 0