Hello,

I am trying to create a customisable - bordered TextBox control=2E=
I draw the border in the overrided method OnPaint, after I have=
previousely set the UserPaint style bit=2E
I make the TextBox Border colouring using=
ControlPaint=2EDrawBorder(=2E=2E) and I need to change the Border=
color whenever the user enters or leaves the client area with te=
mouse=2E
Everithing works fine until I have text in the TextBox, because=
at that point:
1=2E the font changes (into a Windows System one? - quite thick, as=
if bold);
2=2E whenever I Invalidate() the control, and thus repainting, the=
forecolor of the textbox turns white=2E

To try to solve these, I have done the following:

a)attempted to handle myself the text drawing using DrawString()=2E=
It works fine, upto a point when the font keeps changing back -=
I assume it doesn't enter the OnPaint() method ? Because of that=
I have also overriden the OnFontChanging method, Invalidating=
the control and asking it to redraw itself=2E Now the font stays=
the way I want it to, but when typing the caret still moves=
according to the width of the characters of that unknown=
(system?) font=2E

b)intercepted the WM_ERASEBKGND message and sent back the WM_NULL=
message instead, as I thought this would solve the problem=2E

Neither of them worked-out, and now I am asking for your help, as=
I've ran out of ideas=2E
Thank you!

--------------------------------
From: Dragos Lapusneanu

-----------------------
Posted by a user from =2ENET 247 (http://www=2Edotnet247=2Ecom/)

<Id>h3yEE2Lk/069v6lGTjSPfQ=3D=3D</Id>