Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello Everyone,
I have an checkbox option in my userform. How do I get it to blank or GRAY out a TextBox area when the box is checked?? I saw a sample of how to UNBLANK a textbox with the enable feature, but I need the opposite. What is the opposite of enable? a.. 1.. Insert the following statement as the body of the new chkMonth_Click procedu b.. txtMonth.Enabled = chkMonth.Value c.. This statement will enable the text box whenever the check box is selected, and disable the text box whenever the check box is cleared. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Enable is either true or false. The opposite of enabled = True is enabled =
False you item b seems to do that already. If you want it to operate opposite of the checkbox status then txtMonth.Enabled = not chkMonth.Value -- Regards, Tom Ogilvy "Michael Vaughan" wrote in message ... Hello Everyone, I have an checkbox option in my userform. How do I get it to blank or GRAY out a TextBox area when the box is checked?? I saw a sample of how to UNBLANK a textbox with the enable feature, but I need the opposite. What is the opposite of enable? a.. 1.. Insert the following statement as the body of the new chkMonth_Click procedu b.. txtMonth.Enabled = chkMonth.Value c.. This statement will enable the text box whenever the check box is selected, and disable the text box whenever the check box is cleared. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Tom,
Well, I put in the "txtMonth.Enabled = not chkMonth.Value" and the chkMonth Box does NOT gray out when I check the box. Am I doing something wrong?? I want an input box of txtMonth to gray out when I check the checkbox chkMonth. Thanks for all your help... mv "Tom Ogilvy" wrote in message ... Enable is either true or false. The opposite of enabled = True is enabled = False you item b seems to do that already. If you want it to operate opposite of the checkbox status then txtMonth.Enabled = not chkMonth.Value -- Regards, Tom Ogilvy "Michael Vaughan" wrote in message ... Hello Everyone, I have an checkbox option in my userform. How do I get it to blank or GRAY out a TextBox area when the box is checked?? I saw a sample of how to UNBLANK a textbox with the enable feature, but I need the opposite. What is the opposite of enable? a.. 1.. Insert the following statement as the body of the new chkMonth_Click procedu b.. txtMonth.Enabled = chkMonth.Value c.. This statement will enable the text box whenever the check box is selected, and disable the text box whenever the check box is cleared. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub CheckBox1_Click()
TextBox1.Enabled = Not CheckBox1.Value End Sub worked fine for me. There was no visible change to the textbox, but I couldn't enter the textbox and enter a value when the checkbox was checked. Are you using ActiveX controls or controls from the forms toolbar? If activeX, you can get some visual feedback with Private Sub CheckBox1_Click() TextBox1.Enabled = Not CheckBox1.Value If CheckBox1.Value Then TextBox1.SpecialEffect = fmSpecialEffectFlat Else TextBox1.SpecialEffect = fmSpecialEffectSunken End If End Sub or you can set the backcolor to gray. -- Regards, Tom Ogilvy "Michael Vaughan" wrote in message ... Hi Tom, Well, I put in the "txtMonth.Enabled = not chkMonth.Value" and the chkMonth Box does NOT gray out when I check the box. Am I doing something wrong?? I want an input box of txtMonth to gray out when I check the checkbox chkMonth. Thanks for all your help... mv "Tom Ogilvy" wrote in message ... Enable is either true or false. The opposite of enabled = True is enabled = False you item b seems to do that already. If you want it to operate opposite of the checkbox status then txtMonth.Enabled = not chkMonth.Value -- Regards, Tom Ogilvy "Michael Vaughan" wrote in message ... Hello Everyone, I have an checkbox option in my userform. How do I get it to blank or GRAY out a TextBox area when the box is checked?? I saw a sample of how to UNBLANK a textbox with the enable feature, but I need the opposite. What is the opposite of enable? a.. 1.. Insert the following statement as the body of the new chkMonth_Click procedu b.. txtMonth.Enabled = chkMonth.Value c.. This statement will enable the text box whenever the check box is selected, and disable the text box whenever the check box is cleared. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
HOW TO DO ENABLE ENABLE THE QUERY PARAMETER BUTTON? | Excel Worksheet Functions | |||
How to enable to click a checkbox? | Excel Discussion (Misc queries) | |||
How to have Checkbox A uncheck with checked Checkbox B | Excel Discussion (Misc queries) | |||
Checkbox!! | Excel Discussion (Misc queries) | |||
Checkbox | Excel Discussion (Misc queries) |