|
-
Nov 20th, 2000, 10:58 AM
#1
Thread Starter
Lively Member
I am using a check box to toggle a text box's visible state from tru to false. This is what I have:
Private Sub chk1_Click()
If chk1.Enabled = True Then
Text3.Visible = True
Else
chk1.Enabled = False
Text3.Visible = False
End If
End Sub
When the program starts, Text3 is hidden as it should be. When you check the box, Text3 appears as it should. But when you uncheck the box, Text3 does not dissappear as it should. What didn't I do?
Thank You.
-
Nov 20th, 2000, 11:02 AM
#2
Addicted Member
I believe with Check Boxes You must
use '0' , '1' instead of true and false.
I think checkboxes check for integers.
So
if chk1 = 0 then
yack yack
else
if chk1 =1 then
yack yack.
end if.
-
Nov 20th, 2000, 11:05 AM
#3
Thread Starter
Lively Member
That was it! Thank you.
Yack.
-
Nov 20th, 2000, 11:06 AM
#4
Addicted Member
-
Nov 20th, 2000, 11:07 AM
#5
Well ...
Try this:
Code:
Private Sub Check1_Click()
Text1.Visible = Check1.Value
End Sub
-
Nov 20th, 2000, 11:12 AM
#6
To make life easier, how about this simple little method? 
Code:
Private Sub Check1_Click()
Text3.Visible = Not Text3.Visible
End Sub
-
Nov 20th, 2000, 11:13 AM
#7
Thread Starter
Lively Member
-
Nov 20th, 2000, 12:47 PM
#8
Junior Member
Code:
If Check1.Value = vbChecked Then Text1.Visible = True Else Text1.Visible = False
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
|