How do I redraw a custom control?

  • Thread starter Thread starter M O J O
  • Start date Start date
M

M O J O

(using VB.net)

Hi,

I've created my own component inheriting from the RichTextBox.

I override the WndProc's WM_NCPAINT so I can draw my own border (color).

When I set my BorderColor property, then I want to refresh my component
to draw the new bordercolor.

I've tried with invalidate and refresh, but none of those make the
WndProc's WM_NCPAINT to be called.

How do I make the WndProc's WM_NCPAINT to be called in my component?

Thanks!

M O J O
 
Are you by any chance calling hte base class implementations *after* your
drawing code which might paint the border as default

--Saurabh
 
Hi Mojo,


Thanks for posting in the community.

One of my colleague has replied to your post in the newsgroup below.

Subject: How do I redraw a custom control?
Newsgroups: microsoft.public.dotnet.framework.windowsforms.controls

You may go and take a look to see if that help you?


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Try the Win32 function RedrawWindow with the RDW_FRAME and RDW_INVALIDATE
flags

/claes
 
Back
Top