UserPaint problem with TextBox

S

Sujay Ghosh

Hi,

I am deriving my user control from TextBox .

As I want to do some drawing within the textbox , I am doing the following :-

1) SetStyle(ControlStyles.UserPaint , true );
2) Overriding OnPaint

The drawing stuff works fine in OnPaint .

The problem happens with the font ;
Though I have set the font property to "Arial", 12 pt .

the effect is not there when ==> SetStyle(ControlStyles.UserPaint , true );

I want to have the Arial font as well I need to do the drawing.

I tried with WM_PRINT , and PRF_CLIENT but it did not work .

Please let me know how to acheive the above .