ashley Posted August 28, 2007 Share Posted August 28, 2007 ok i have a problem: when exit is pressed on my Set transparency window it closes whole program even tho is ment to just exit that loop: Here my code:(well part of it) expandcollapse popup#include <GUIConstants.au3> $Form1 = GUICreate("test", 500, 541) $transparency = GUICtrlCreateButton("Set Transparency", 80, 515, 95, 25, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $transparency transparency() EndSwitch WEnd Func transparency() $Form2 = GUICreate("Set transparency.", 345, 80, 191, 109) $Slider1 = GUICtrlCreateSlider(32, 32, 281, 41) $Label1 = GUICtrlCreateLabel("Move the Slider Across the bar to make the window more transparent", 8, 8, 329, 17) GUISetState(@SW_SHOW) GUICtrlSetLimit($Slider1, 5, 1) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE ExitLoop Case $Slider1 $TransLevel = GUICtrlRead($Slider1) Switch $TransLevel Case 1 WinSetTrans($Form1, "", 255) Case 2 WinSetTrans($Form1, "", 200) Case 3 WinSetTrans($Form1, "", 150) Case 4 WinSetTrans($Form1, "", 100) Case 5 WinSetTrans($Form1, "", 50) Case 6 WinSetTrans($Form1, "", 0) EndSwitch EndSwitch WEnd EndFunc any ideas Free icons for your programs Link to comment Share on other sites More sharing options...
ashley Posted August 28, 2007 Author Share Posted August 28, 2007 12 views and nobody know whats wrong? weres the experts today Free icons for your programs Link to comment Share on other sites More sharing options...
ChrisL Posted August 28, 2007 Share Posted August 28, 2007 expandcollapse popup#include <GUIConstants.au3> $Form1 = GUICreate("test", 500, 541) $transparency = GUICtrlCreateButton("Set Transparency", 80, 515, 95, 25, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg(1) Switch $nMsg[0] Case $GUI_EVENT_CLOSE If $nMsg[1] = $Form1 then Exit Case $transparency transparency() EndSwitch WEnd Func transparency() $Form2 = GUICreate("Set transparency.", 345, 80, 191, 109) $Slider1 = GUICtrlCreateSlider(32, 32, 281, 41) $Label1 = GUICtrlCreateLabel("Move the Slider Across the bar to make the window more transparent", 8, 8, 329, 17) GUISetState(@SW_SHOW) GUICtrlSetLimit($Slider1, 5, 1) While 1 $Msg = GUIGetMsg(1) Switch $Msg[0] Case $GUI_EVENT_CLOSE If $Msg[1] = $Form2 then ExitLoop(1) Case $Slider1 $TransLevel = GUICtrlRead($Slider1) Switch $TransLevel Case 1 WinSetTrans($Form1, "", 255) Case 2 WinSetTrans($Form1, "", 200) Case 3 WinSetTrans($Form1, "", 150) Case 4 WinSetTrans($Form1, "", 100) Case 5 WinSetTrans($Form1, "", 50) Case 6 WinSetTrans($Form1, "", 0) EndSwitch EndSwitch WEnd GuiDelete($form2) EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
ashley Posted August 28, 2007 Author Share Posted August 28, 2007 expandcollapse popup#include <GUIConstants.au3> $Form1 = GUICreate("test", 500, 541) $transparency = GUICtrlCreateButton("Set Transparency", 80, 515, 95, 25, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg(1) Switch $nMsg[0] Case $GUI_EVENT_CLOSE If $nMsg[1] = $Form1 then Exit Case $transparency transparency() EndSwitch WEnd Func transparency() $Form2 = GUICreate("Set transparency.", 345, 80, 191, 109) $Slider1 = GUICtrlCreateSlider(32, 32, 281, 41) $Label1 = GUICtrlCreateLabel("Move the Slider Across the bar to make the window more transparent", 8, 8, 329, 17) GUISetState(@SW_SHOW) GUICtrlSetLimit($Slider1, 5, 1) While 1 $Msg = GUIGetMsg(1) Switch $Msg[0] Case $GUI_EVENT_CLOSE If $Msg[1] = $Form2 then ExitLoop(1) Case $Slider1 $TransLevel = GUICtrlRead($Slider1) Switch $TransLevel Case 1 WinSetTrans($Form1, "", 255) Case 2 WinSetTrans($Form1, "", 200) Case 3 WinSetTrans($Form1, "", 150) Case 4 WinSetTrans($Form1, "", 100) Case 5 WinSetTrans($Form1, "", 50) Case 6 WinSetTrans($Form1, "", 0) EndSwitch EndSwitch WEnd GuiDelete($form2) EndFunc thanks Free icons for your programs Link to comment Share on other sites More sharing options...
Josbe Posted August 28, 2007 Share Posted August 28, 2007 (edited) TIP: Some things useful to know:• GUICloseOnESC option.• GUISwitch().• GUIDelete().EDIT: ..and ExitLoop levels. Edited August 28, 2007 by Josbe AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
Developers Jos Posted August 28, 2007 Developers Share Posted August 28, 2007 expandcollapse popup#Tidy_Parameters=/rel 1 #include <GUIConstants.au3> $Form1 = GUICreate("test", 500, 541) $transparency = GUICtrlCreateButton("Set Transparency", 80, 515, 95, 25, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $transparency transparency() EndSwitch WEnd Func transparency() $Form2 = GUICreate("Set transparency.", 345, 80, 191, 109) $Slider1 = GUICtrlCreateSlider(32, 32, 281, 41) $Label1 = GUICtrlCreateLabel("Move the Slider Across the bar to make the window more transparent", 8, 8, 329, 17) GUISetState(@SW_SHOW,$Form2) GUICtrlSetLimit($Slider1, 5, 1) While 1 $Msg = GUIGetMsg($Form2) Switch $Msg Case $GUI_EVENT_CLOSE GUIDelete($Form2) ExitLoop Case $Slider1 $TransLevel = GUICtrlRead($Slider1) Switch $TransLevel Case 1 WinSetTrans($Form1, "", 255) Case 2 WinSetTrans($Form1, "", 200) Case 3 WinSetTrans($Form1, "", 150) Case 4 WinSetTrans($Form1, "", 100) Case 5 WinSetTrans($Form1, "", 50) Case 6 WinSetTrans($Form1, "", 0) EndSwitch EndSwitch WEnd EndFunc ;==>transparency SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
ashley Posted August 28, 2007 Author Share Posted August 28, 2007 Ive fixed it thanks ChrisL Free icons for your programs Link to comment Share on other sites More sharing options...
Monamo Posted August 28, 2007 Share Posted August 28, 2007 JdeB beat me to it And I always forget about GUISwitch, tnx Josbe - MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now