Jump to content

clear / erase gui buttons,text, ect


cos
 Share

Recommended Posts

Hi,

i have made an application that when you hit a button you go to the next step and hit another you go again a step further (every time you hit the button the next button is shown). But here is the question, when i come to the end i have a end button (closes the program) and a return button. What i want is when you click on the return button you start over again, so my GUI has to be cleared, and the first button is shown again.

is there a function or a way to clean up the GUI so every text, button ect is erased??

any suggestion is welcome

thanks

Link to comment
Share on other sites

is this what you want.

#include <GUIConstants.au3>


$Form1 = GUICreate("Form1", 261, 166, 193, 125)
$Button1 = GUICtrlCreateButton("Button1", 64, 40, 129, 33, 0)
$Button2 = GUICtrlCreateButton("Button2", 64, 80, 129, 41, 0)
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        case $Button2
            GUICtrlSetData($Button1,"NEW TEXT")
                                                GUICtrlDelete($Button2)
    EndSwitch
WEnd
Edited by Aceguy
Link to comment
Share on other sites

That is indeed what i needed, thanks.

but i also notice that it does not work for the GUICtrlCreateInput. i have this in my code

$scan = GUICtrlCreateInput ("",10, 260, 200, 20)

but when i delete $scan (GUICtrlDelete ($scan_serialnumber)) it does not delete. I also got a failure on the return value. So how can i delete this one?

thanks a lot

Link to comment
Share on other sites

GUICtrlSetData($scan,"")

or

GUICtrlDelete($scan)

sorry i made a typo so the GUICtrlDelete($scan) (and not GUICtrlDelete(($scan_serialnumber) what i typed first) does not work also the GUICtrlSetData($scan,"") doesn't do anything.

thanks

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...