zxtnt09 Posted September 22, 2015 Share Posted September 22, 2015 (edited) Hi guys,i have problem with this : expandcollapse popup#include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> GUI() Func GUI() Global $MyForm = GUICreate("My GUI edit",500,300,100,100) GUISetState(@SW_SHOW) GUISetFont(12, 400, 0, "Tahoma") $Label1 = GUICtrlCreateLabel("Label 01 ",0, 0, 50 , 25 ) $Label1 = GUICtrlCreateLabel("Label 01 ",0, 50, 50 , 25 ) Global $BTN1 = GUICtrlCreateButton("BTN 1 ", 150, 0, 50, 25) Global $BTN2 = GUICtrlCreateButton("BTN 2", 150, 50, 50, 25) EndFunc ;Function Func Test1() If $BTN1 = True Then Local $Edit1 = GUICtrlCreateEdit("Edit 1", 0, 80, 200, 200) EndIf EndFunc Func Test2() If $BTN2 = True Then Local $Edit2 = GUICtrlCreateEdit("Edit 2", 200, 80, 200, 200) EndIf EndFunc While 1 Switch GUIGetMsg() Case $BTN1 If $BTN1 = True Then Test1 () EndIf Case $BTN2 If $BTN2 = True Then Test2 () EndIf Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd* i want to : after click on "$BTN 1" , "$Edit2" was hidden or after click on "$BTN 2" , "$Edit1" was hidden. Edited September 22, 2015 by zxtnt09 Image Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 22, 2015 Moderators Share Posted September 22, 2015 zxtnt09,Simple - just hide/show the edits as required:expandcollapse popup#include <GUIConstantsEx.au3> Global $MyForm, $BTN1, $BTN2, $Edit1, $Edit2 GUI() While 1 Switch GUIGetMsg() Case $BTN1 GUICtrlSetState($Edit2, $GUI_HIDE) GUICtrlSetState($Edit1, $GUI_SHOW) Case $BTN2 GUICtrlSetState($Edit1, $GUI_HIDE) GUICtrlSetState($Edit2, $GUI_SHOW) Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func GUI() $MyForm = GUICreate("My GUI edit", 500, 300, 100, 100) GUISetFont(12, 400, 0, "Tahoma") $Label1 = GUICtrlCreateLabel("Label 01 ", 0, 0, 50, 25) $Label1 = GUICtrlCreateLabel("Label 01 ", 0, 50, 50, 25) $BTN1 = GUICtrlCreateButton("BTN 1 ", 150, 0, 50, 25) $BTN2 = GUICtrlCreateButton("BTN 2", 150, 50, 50, 25) $Edit1 = GUICtrlCreateEdit("Edit 1", 0, 80, 200, 200) $Edit2 = GUICtrlCreateEdit("Edit 2", 200, 80, 200, 200) GUICtrlSetState($Edit2, $GUI_HIDE) GUISetState(@SW_SHOW) EndFunc ;==>GUIAnd it is not good coding practice to declare Global variables inside functions - so I changed that too.M23 zxtnt09 1 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...
zxtnt09 Posted September 22, 2015 Author Share Posted September 22, 2015 Like everytime great, Thanks Melba23 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