Sign in to follow this  
Followers 0
HeidiR

GUICtrlCreateButton and $GUI_HIDE

9 posts in this topic

Is there a way to hide a control with GUICtrlCreateButton()?

Example: GUICtrlCreateButton("", 10, 10, 60, 25, $GUI_HIDE)

I have tried the example code above but it doesn't work. However, I can use GUICtrlSetState ($button4, $GUI_HIDE) after creation successfully.


HeidiRFind free applications, code examples and more on my site at:http://heidisdownloads.com/

Share this post


Link to post
Share on other sites



you trying to make like an invisible button? that only you know where it is to click it?


Giggity

Share this post


Link to post
Share on other sites

you trying to make like an invisible button? that only you know where it is to click it?

Actually, I'm trying to create two buttons on top of each other on the GUI (same x and y). A Process button and an Abort button. Initially, I want the process button shown and enabled and the abort button hidden and disabled. When the process button is clicked, I want the abort button shown and enabled and the process button hidden and disabled.


HeidiRFind free applications, code examples and more on my site at:http://heidisdownloads.com/

Share this post


Link to post
Share on other sites

What about deleting the process button after it is pressed, then adding the abort button in its place?


Giggity

Share this post


Link to post
Share on other sites

Actually, I'm trying to create two buttons on top of each other on the GUI (same x and y). A Process button and an Abort button. Initially, I want the process button shown and enabled and the abort button hidden and disabled. When the process button is clicked, I want the abort button shown and enabled and the process button hidden and disabled.

If that's the case I would just use the same button and change the text. And then wherever your register that the button has been pressed you could do something like this:

If GUICtrlRead($yourBtnCtrl) = 'Process' then 
;do whatever
Else;that means the button says abort
;do whatever
EndIf

Set the text of the button using this:

GUICtrlSetData($yourBtnCtrl, 'Abort')

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

There ya go, I like that idea much better.


Giggity

Share this post


Link to post
Share on other sites

If that's the case I would just use the same button and change the text. And then wherever your register that the button has been pressed you could do something like this:

If GUICtrlRead($yourBtnCtrl) = 'Process' then 
;do whatever
Else;that means the button says abort
;do whatever
EndIf

Set the text of the button using this:

GUICtrlSetData($yourBtnCtrl, 'Abort')
Achilles, Thanks for the information! That solution worked fine. For future reference, I'm guessing that it's NOT possible to create a control with a state of disabled or hidden with GUICtrlCreate... Is this accurate?

HeidiRFind free applications, code examples and more on my site at:http://heidisdownloads.com/

Share this post


Link to post
Share on other sites

_GUICtrlButton_Show

just found that in the help, and I've see the disable before, didn't see it this look through though


Giggity

Share this post


Link to post
Share on other sites

Achilles, Thanks for the information! That solution worked fine. For future reference, I'm guessing that it's NOT possible to create a control with a state of disabled or hidden with GUICtrlCreate... Is this accurate?

I don't think so.. but in reality I don't think it would be very useful. I have thought of this before but then just wrote the script with creating the buttons and immediately after disabling them (with the GUI showing) and it worked fine. I couldn't even notice that the buttons were being created enabled. Haven't tried it with hiding and showing though.

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

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  
Followers 0