BlazeLondon Posted March 27, 2006 Share Posted March 27, 2006 does anyone know if you use an input box how you can clear it? #include <GUIConstants.au3> dim $share,$uname,$pw $Main = GUICreate("input",320,200) $sharen = GuiCtrlCreateInput($share, 120, 55, 170, 20) $usname = GuiCtrlCreateInput($uname, 120, 80, 170, 20) $pwd = GuiCtrlCreateInput($pw, 120, 105, 170, 20) $Submit = GuiCtrlCreateButton("Add", 120,140,70,20) GuiSetState(@SW_SHOW,$main) If Not WinActive($Main) Then WinActivate($Main) While 1 $msg = GUIGetMsg() select Case $msg = $GUI_EVENT_CLOSE exit (3) Case $msg = $submit $share = GuiCtrlRead ($sharen) $uname = GuiCtrlRead ($usname) $pw = GuiCtrlRead ($pwd) for $i = 1 to 1 if $share = "" Then msgbox (16,"Question","Please give input") exitloop endif iniwrite ("~netfldr.qbw", $share,"Name",$share) if not $uname = "" Then IniWrite ( "~netfldr.qbw", $share, "User", $uname ) if not $pw = "" Then IniWrite ( "~netfldr.qbw", $share, "Password", $pw ) GUICtrlSetData($share, '') GUICtrlSetData($uname, '') ; <------ here im tryin to clear the boxes to take GUICtrlSetData($pw, '') the input again! guictrlclose() GuiSetState(@SW_SHOW,$main) next EndSelect WEnd GUIDelete() Exit Link to comment Share on other sites More sharing options...
greenmachine Posted March 27, 2006 Share Posted March 27, 2006 (edited) You have to set the data of the control, not the text. You try to clear these: GUICtrlSetData($share, '') GUICtrlSetData($uname, '') ; <------ here im tryin to clear the boxes to take GUICtrlSetData($pw, '') the input again! But these are the controls: $sharen = GuiCtrlCreateInput($share, 120, 55, 170, 20) $usname = GuiCtrlCreateInput($uname, 120, 80, 170, 20) $pwd = GuiCtrlCreateInput($pw, 120, 105, 170, 20) Edited March 27, 2006 by greenmachine Link to comment Share on other sites More sharing options...
BlazeLondon Posted March 27, 2006 Author Share Posted March 27, 2006 You have to set the data of the control, not the text.You try to clear these:GUICtrlSetData($share, '')GUICtrlSetData($uname, '') ; <------ here im tryin to clear the boxes to takeGUICtrlSetData($pw, '') the input again!But these are the controls:$sharen = GuiCtrlCreateInput($share, 120, 55, 170, 20)$usname = GuiCtrlCreateInput($uname, 120, 80, 170, 20)$pwd = GuiCtrlCreateInput($pw, 120, 105, 170, 20)doh! 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