|
-
Oct 17th, 2006, 11:40 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] [2005] Paint event not triggering
Hello everyone,
I am using GDI+ to paint the form,its labels and its groupboxes with a gradient color.
But the problem Im facing is that the paint event doesnt trigger sometimes for the groupboxes and labels as it does for the form.
What could be the problem for this?
Please help,
Thanks so much,
Godwin
Help someone else with what someone helped you! 
-
Oct 17th, 2006, 11:45 PM
#2
Re: [2005] Paint event not triggering
The Paint event is raised every time the control requires repainting, period. If the control doesn't require repainting then its Paint event is not raised. .NET tries to do as little painting as possible because it is very time consuming. I haven't tested it but it is quite plausible that the forms Paint event will be raised because the form itself has changed but the region occupied by a particular control has not changed so that control's Paint event is not raised. If you want to force a control to be repainted at any time then you can call its Refresh or Invalidate method. Again, you should avoid any unnecessary repainting, so it is preferable to call the Inavlidate method and specify the area that has changed. It takes much less time to calculate that area than it does to repaint the are athat hasn't changed.
-
Oct 20th, 2006, 02:04 AM
#3
Thread Starter
Fanatic Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|