CrewXp Posted April 11, 2006 Share Posted April 11, 2006 Func MainGui() $maingui =GUICreate("CrewKit",240,180) Draw();Creates the 1-6 butttons, not the back GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $1filemanager Then FileManager() If $msg = $2links Then Links() If $msg = $3misc Then Misc() If $msg = $4send2tray Then Hide() If $msg = $5about Then About() If $msg = $6close Then ExitLoop If $msg = $6back Then ExitLoop Wend GUIDelete() EndFunc $6back is a button created in the function FileManager() after I click the $1filemanager button created in Draw(). It deletes the Draw Controls and re-creates buttons.(One of which being $6back). I'm getting "variable used without being declared". After I try to run it. If I add Global $6back to the top, it automatically closes the loop. Thanks. This is my close button creation in Draw() GLOBAL $6close = GUICtrlCreateButton ("Close", 200,0,40,40,$BS_ICON) GUICtrlSetImage (-1, "CrewKit.icl",0) GUICtrlSetTip(-1,"Close") This is my back button creation in FileManager() GUICtrlDelete($6close) GLOBAL $6back = GUICtrlCreateButton ("Back", 200,0,40,40,$BS_ICON) GUICtrlSetImage (-1, "CrewKit.icl",0) GUICtrlSetTip(-1,"Back") Link to comment Share on other sites More sharing options...
Valuater Posted April 11, 2006 Share Posted April 11, 2006 1 Create the Button $6back in Draw() then use GUICtrlSetState( -1, $GUI_HIDE) 2 because eyou have already used GuiSetState() to show the GUI...it is difficult to create new controls for that GUI however you can chage the data and control tip ( looks like the pic is the same ) do this in the FileManager() GuiCtrlSetData( $6back, "back") GUICtrlSetTip( $6back, "back") however in you while/wend loop you will need to use GuiCtrlRead($6back) to see if is "close" or "back" to use it correctly 8) Link to comment Share on other sites More sharing options...
GaryFrost Posted April 11, 2006 Share Posted April 11, 2006 why not just create both buttons and instead of creating/deleting just show/hide the buttons desired. 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 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