Jump to content

Controlhide/show()


Recommended Posts

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]

Link to comment
Share on other sites

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


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

Link to comment
Share on other sites

  • Developers

Looks like you are hiding the word you use to match the window with ...

maybe setting opt("WinDetectHiddenText",1) helps ?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

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


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

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...