Jump to content
Sign in to follow this  
GrungeRocker

Controlhide/show()

Recommended Posts

GrungeRocker

hi i have made a small script:

;~ HIDE STARTBUTTON
Func startbtnhide()
    ControlHide("", "Start", 304)
EndFunc
;~ SHOW STARBUTTON
Func startbtnshow()
    ControlShow("", "Start", 304)
EndFunc

hiding works 100% but showing doesn't... why?

Edited by Analritter

[font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font]

Share this post


Link to post
Share on other sites
BigDod

If this is in a GUI that you made you could use GUICtrlSetState

#include <GUIConstants.au3>
HotKeySet("{PAUSE}", "startbtnhide")
HotKeySet("{ESC}", "startbtnshow")

GUICreate("My GUI Button") ; will create a dialog box that when displayed is centered

Opt("GUICoordMode",2)
$btn1=GUICtrlCreateButton ("OK",  10, 30, 50)
$btn2=GUICtrlCreateButton ( "Cancel",  0, -1)

GUISetState ()    ; will display an  dialog box with 2 button

; Run the GUI until the dialog is closed
While 1

    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

;~ HIDE STARTBUTTON
Func startbtnhide()
   GUICtrlSetState($btn1,$GUI_HIDE)
EndFunc
;~ SHOW STARBUTTON
Func startbtnshow()
    GUICtrlSetState($btn1,$GUI_SHOW)
EndFunc


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites
SmOke_N

Err... no... it's the actual Start Button (Same Control ID)

Edit:

This works:

Opt('wintitlematchmode', 4)
Opt('windetecthiddentext', 1)
ControlHide('classname=Shell_TrayWnd', 'start', 'Button1')
Sleep(3000)
ControlShow('classname=Shell_TrayWnd', 'start', 'Button1')

Edit2:

Ahh, didn't see Lar and Jdeb already responded!!

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
GrungeRocker

thanks!

don't worry SmOke_N i'm not making any damage stuff :o

just wanna to kid a friend XD


[font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font]

Share this post


Link to post
Share on other sites
BigDod

Err... no... it's the actual Start Button (Same Control ID)

Edit:

This works:

Opt('wintitlematchmode', 4)
Opt('windetecthiddentext', 1)
ControlHide('classname=Shell_TrayWnd', 'start', 'Button1')
Sleep(3000)
ControlShow('classname=Shell_TrayWnd', 'start', 'Button1')
:o


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
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
Sign in to follow this  

×