Click to See Complete Forum and Search --> : OnPaint method for System.Windows.Forms.TextBox


AniJoshi
October 22nd, 2002, 09:47 PM
Hello,
I have created a custom TextBox control by inheriting from System.Windows.Forms.TextBox and I'm changing a bunch of display properties by Overriding the OnPaint method for the derived control.
But the OnPaint method is not getting called when the derived control is placed on the Form, and the form is displayed at runtime. This is working for other controls like Label, CheckBox etc.
My question is, when does the Paint event, raised for the TextBox control? Also if overriding the OnPaint method will not work for the Text Box control then what is the alternate method I can use. I want to change the display properties of the derived TextBox control only when it gets displayed.
I'm changing the following properties : BackColor, ForeColor and Font

Thanks,
Ani