On May 10, 3:13 pm, "Martin Arvidsson, Visual Systems AB"
<martin.arvids...@vsab.netwrote:
Hi!
I have a textBox on a windows form.
Can i overide the textbox OnPaint directly in the form, if so how.
Or do i have to inherit the textbox control and overide it there?
Regards
Martin
Martin,
There is no native .NET way to override the OnPaint besides inheriting
it that I know about.
You can subclass the textBox and override the WM_PAINT message using
interop services.
You can use inherit NativeWindow class and attach the window handle of
the TextBox to a it. The concrete class will override the WndProc
method and handle the WM_PAINT message in it.
Hope it helps.
Moty.