|
-
Nov 20th, 2004, 02:50 PM
#1
Thread Starter
New Member
Resolved - Make text on button disappear and reappear
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
Last edited by Diane; Nov 21st, 2004 at 12:53 PM.
-
Nov 20th, 2004, 02:56 PM
#2
Hyperactive Member
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...
My software never has bugs. It just develops random features.
I RATE, YOU RATE!!!
-
Nov 20th, 2004, 05:13 PM
#3
Addicted Member
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.
-
Nov 20th, 2004, 09:33 PM
#4
Thread Starter
New Member
I'll give this a try
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
-
Nov 20th, 2004, 11:04 PM
#5
Addicted Member
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
-
Nov 21st, 2004, 12:52 PM
#6
Thread Starter
New Member
resolved
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|