473,326 Members | 2,680 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How do I redraw a custom control?

(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

Nov 20 '05 #1
3 2305
Are you by any chance calling hte base class implementations *after* your
drawing code which might paint the border as default

--Saurabh

"M O J O" <mojo@_no_spam_delete_this_newwebsolutions.dk> wrote in message
news:OI**************@TK2MSFTNGP11.phx.gbl...
(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

Nov 20 '05 #2
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.con trols

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.

Nov 20 '05 #3
Try the Win32 function RedrawWindow with the RDW_FRAME and RDW_INVALIDATE
flags

/claes

"M O J O" <mojo@_no_spam_delete_this_newwebsolutions.dk> wrote in message
news:OI**************@TK2MSFTNGP11.phx.gbl...
(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

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: PHH | last post by:
Help me, please, When I redraw a ListviewItem in Listview (redraw items with icon and text columms). I used SetStyle(ControlStyle.UserPaint, true) function. And I redraw finish and run...
0
by: WHITETIGER | last post by:
Help me, please, When I redraw a ListviewItem in Listview (redraw items with icon and text columms). I used SetStyle(ControlStyle.UserPaint, true) function. And I redraw finish and run...
2
by: Jose Michael Meo R. Barrido | last post by:
I made a custom runded rectangle usercontrol. I used a function i found on the internet. the function works fine(see "GetRoundRect" below). I use the fullowing code to make my usercontrol...
5
by: CroDude | last post by:
Hi all! I've made a simple control derived from a panel class which draws gradient in a overrided OnPaintBackground event. Well, I know that I need to redraw control when it's resized by...
1
by: Christopher Shanahan | last post by:
Hello, I've built a data entry form for a survey database that appears to make the entire form flicker when I mouse over anyn of the label controls. I suspect that it has to do with the...
0
by: Dean Earley | last post by:
Hi all. I have just added translucency to one of my applications using the layered windows API, but I have come across a redraw problem. Unfortunately, I cant reproduce this in a standalone...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
0
by: Warenth | last post by:
In C#, how do I force Visual Studio to redraw my custom web control after a specific property has change. Thanks, Warenth
6
by: Martin Slater | last post by:
Hi all, I'm using a webbrowser control within an application for the UI and want to hide the flicker and redraw when changing pages. Ideally I want to render the new page to a seperate...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.