AlienStar Posted January 12, 2010 Share Posted January 12, 2010 (edited) hello everybody I use this script to make GUI readme for just once and this is :#include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) _Main() Func _Main() Local $gobutton, $state, $msg, $Chekbox Local $pic #forceref $separator1 GUICreate("Readme", 600, 400) $gobutton = GUICtrlCreateButton("GO", 265, 350, 100, 25) $pic = GuiCtrlCreatePic("pic.jpg",0,0, 600,300) $Chekbox = GuiCtrlCreateCheckbox("Don't show this message again", 25, 370, 200, 20) $state = GuiCtrlSetState(-1, $GUI_UNCHECKED) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE MsgBox(0, "Click", "good bye") ExitLoop Case $msg = $gobutton MsgBox(0, "Click", "You clicked OK!") ExitLoop EndSelect WEnd GUIDelete() Exit EndFuncI suggest when the box is checked write text file somewhere and next time check that file then won't show this again and I used in Func _Main() for checkbox :when it's checked ---- > write a text file when it's unchecked ---- > delete that file like this Func _Main() While 1 Select Case $state = GuiCtrlSetState(1, $GUI_CHECKED) FileWrite ("File.txt","Text") Case $state = GuiCtrlSetState(-1, $GUI_UNCHECKED) FileDelete("File.txt") EndSelect WEnd Exit EndFuncbut it didn't work please help me Edited January 12, 2010 by AlienStar Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 12, 2010 Moderators Share Posted January 12, 2010 AlienStar,Using -1 in commands like $state = GuiCtrlSetState(-1, $GUI_UNCHECKED) is shorthand for "the control just created". So when you come to your loop and use Case $state = GuiCtrlSetState(1, $GUI_CHECKED) AutoIt has probably forgotten what that was!You also need to look at the current state of the checkbox - not compare it with what it was. Try using this:Case GUICtrlRead($Chekbox) = 1 ; This is checkedCase GUICtrlRead($ChekBox) = 4 ; This is uncheckedM23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
AlienStar Posted January 12, 2010 Author Share Posted January 12, 2010 @Melba23 it works fine thanks so so much you are amazing Link to comment Share on other sites More sharing options...
AlienStar Posted January 14, 2010 Author Share Posted January 14, 2010 (edited) @Melba23 I have another question please as you see in script above $pic = GuiCtrlCreatePic("pic.jpg",0,0, 600,300) I wanna put a button or checkbox where the pic is placed but they set behind it now how can arrange it to back (bring them to front) ?? and thanks Edited January 14, 2010 by AlienStar Link to comment Share on other sites More sharing options...
AlienStar Posted January 14, 2010 Author Share Posted January 14, 2010 thanks Thanubis but I found that's not enough because nothing happen after putting this $pic = GuiCtrlCreatePic("pic.jpg",0,0, 600,400) GuiCtrlSetState(-1,$GUI_DISABLE)so I looked for that in help and found GuiCtrlSetState(-1,$GUI_ONTOP)after using this $pic = GuiCtrlCreatePic("pic.jpg",0,0, 600,400) GuiCtrlSetState(-1,$GUI_DISABLE) GuiCtrlSetState(-1,$GUI_ONTOP)everything becomes well 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