TextBox & Backcolor

  • Thread starter Thread starter Agnes
  • Start date Start date
A

Agnes

When the textbox 's Enabled = True, (its backcolor is white)
When the Textbox got focus (backcolor change to pink by my code)
when the textbox lost focus(back color change to white by my code)
NOw. the problem is "When textbox 's Enabled = false. ( the back color still
white but not gray)
Does anyone know how to solve this problem ??
thanks a lot
 
Agnes said:
When the textbox 's Enabled = True, (its backcolor is white)
When the Textbox got focus (backcolor change to pink by my code)
when the textbox lost focus(back color change to white by my code)
NOw. the problem is "When textbox 's Enabled = false. ( the back color
still white but not gray)

Set the control's 'BackColor' to 'SystemColors.Window' instead of
'Colors.White'.
 
Agnes said:
When the textbox 's Enabled = True, (its backcolor is white)
When the Textbox got focus (backcolor change to pink by my code)
when the textbox lost focus (back color change to white by my code)
NOw. the problem is
"When textbox 's Enabled = false (back color still white not gray)

If the control is disabled, if /can't/ receive focus, so any Focus event
handlers you have won't get a look in.

Try handling the [TextBox].EnabledChanged Event as well as the
focus ones.

HTH,
Phill W.
 
Back
Top