![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Aug 2005
Posts: 1
Rep Power: 0
![]() |
customise TextBox control
When a Windows control such as TextBox or ComboBox is disabled it uses default system colours for the Backcolor and Forecolor attributes. How can I customise these controls to override these attributes. For example, I want the text font to be bold and black when in a disabled state.
thanks |
|
|
|
|
|
#2 |
|
Expert Programmer
|
Well I find that if the colours are non-system ones, the textbox takes those regardless of whether it's enabled or not, so you'd have to write some code to handle the colour changing to indicate a "greyed out" state.
|
|
|
|
|
|
#3 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
I've never tried it myself, but this apparently works: put the control in a PictureBox and set the border to 0. Disable the PictureBox (not the TextBox), and add checking.
|
|
|
|
|
|
#4 | |
|
Expert Programmer
|
Quote:
You could also use the EnableWindow API to just disable the window directly, or override the Enabled property Setter to prevent the repaint, so the colours aren't changed. ![]() |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|