hlstriker Posted May 26, 2005 Share Posted May 26, 2005 Hi, I was wondering if you could clear the text from the Input field with just a press of a button? I know I would need to make an Input field like so... $input = GUICtrlCreateInput ( "I want this cleared with button press!", x, x, x, x ) Then I would need the button... this is what I don't know how to setup to make it clear the text from the Input field. Thanks The best Honda forums!RuneScape High Alching for Profit! Link to comment Share on other sites More sharing options...
Helge Posted May 26, 2005 Share Posted May 26, 2005 (edited) Check out this post...Edit : Sorry, I misread your post.. Edited May 26, 2005 by Helge Link to comment Share on other sites More sharing options...
Helge Posted May 26, 2005 Share Posted May 26, 2005 I'm not sure if you mean that you want the the input to be clear when pressing a keyboard-button, or a GUI-button, but this example shows how to do both : #include <GUIConstants.au3> GUICreate("Test",200,70) $cInput = GUICtrlCreateInput("Blahahahha ! Znjurb ?",10,10,180,20) $cClear = GUICtrlCreateButton("Clear !",10,40,180,20) GUISetState() HotKeySet("{numlock}","_ClearInput") While 1 Sleep(10) $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit If $msg = $cClear Then GUICtrlSetData($cInput,"") WEnd Func _ClearInput() GUICtrlSetData($cInput,"") EndFunc Just press NumLock to clear the input-control, or press the "Clear"-button.. Link to comment Share on other sites More sharing options...
hlstriker Posted May 26, 2005 Author Share Posted May 26, 2005 Well, before you posted that second post.. I read the link you posted at first. I worked everything out from there lol Here is the code I used... Case $msg = $cleartextbutton If $msg = $cleartextbutton Then GUICtrlSetData($input,"") EndIf Thanks for the help The best Honda forums!RuneScape High Alching for Profit! Link to comment Share on other sites More sharing options...
Helge Posted May 26, 2005 Share Posted May 26, 2005 Heh, no problem.Just a little comment on your code.. instead of doing :Case $msg = $cleartextbutton If $msg = $cleartextbutton Then GUICtrlSetData($input,"") EndIfyou could use :Select Case $msg = $cleartextbutton GUICtrlSetData($input,"")With your script I think you really upset the Select, becauseif he's saying that that's the case, then he's very often right.You don't have to ask him once more Damn, my eyes are screaming for new contact-lenses 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