I'm stumped....
I have buttons getting their text randomly on Form load.
But I need them to hide the text until I click on the button. (But not hide the button)
How do I make the text disappear until needed?
Thanx for any help.
Diane
Printable View
I'm stumped....
I have buttons getting their text randomly on Form load.
But I need them to hide the text until I click on the button. (But not hide the button)
How do I make the text disappear until needed?
Thanx for any help.
Diane
Make a string variable for each command...
and
command1.text = "" 'when you want to hide
and use :
command1.text = varstr ' its the variable that holds the random text that you created...
Hi Diane,
All you need do is set the ForeColor of the button to it's BackColor. In the Click event of the button, set the ForeColor back to a color that is different from the BackColor.
Thanx for the fast feedback.
I thought of changing the color, but couldn't find a good match. The backcolor was "control", and when you write the code, only "real" colors are options. So figure thats a dead end. But I still may be able to work on it, I'll try some more.
the other code supplied I will definitely try tomorrow, and let you know!
Thanx for now,
Diane
VB Code:
'in the form load event you can use this to hide the text Me.Button1.ForeColor = Me.Button1.BackColor 'in the click event of the button, use this to show text Me.Button1.ForeColor = Me.ForeColor 'or Me.ForeColor = SystemColors.ControlText 'or Me.ForeColor = Color.Red 'etc
Well, glad to say, both methods worked!
I will use the string variable for my code. Sometimes the obvious is hiding.....
And on the bright side, I now know more about changing forecolor and backcolor !!!
Cheers and many thanx,
Diane