Click here to Skip to main content
15,895,746 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Reading unicode text file in FCL Pin
NOTEPAK19-Apr-05 8:45
NOTEPAK19-Apr-05 8:45 
GeneralCookies and winform Pin
Anonymous16-Apr-05 2:52
Anonymous16-Apr-05 2:52 
GeneralRe: Cookies and winform Pin
Steven Campbell19-Apr-05 6:49
Steven Campbell19-Apr-05 6:49 
GeneralEvent Queuing Question Pin
paulsawyer16-Apr-05 2:27
paulsawyer16-Apr-05 2:27 
GeneralRe: Event Queuing Question Pin
Mike Dimmick18-Apr-05 22:58
Mike Dimmick18-Apr-05 22:58 
GeneralRe: Event Queuing Question Pin
paulsawyer19-Apr-05 7:11
paulsawyer19-Apr-05 7:11 
GeneralRe: Event Queuing Question Pin
Mike Dimmick19-Apr-05 8:12
Mike Dimmick19-Apr-05 8:12 
GeneralRe: Event Queuing Question Pin
Dave Kreskowiak19-Apr-05 8:14
mveDave Kreskowiak19-Apr-05 8:14 
Your form will get OnPaint events whenever Windows need the window to redraw itself. In general, this is caused by any other form or application being drawn over your form, or if you resize or move your form at all. You can get the OnPaint event AT ANY TIME and quite frequently. You'll end up seeing the event fire dozens of time per second in the case of a window resize.

Having said that, you, also, can't stop the OnPaint from happening either. Your OnPaint code should do nothing but paint, and paint only what it has to. No dialogs, no data manipulations, no nothing! If you need data to draw the form properly, you should only be doing read-only operations on that data. It might even help, if your situation allows, if you precalculated constant values that your paint code might need. Your paint code should be as small as possible and execute as fast as possible in order to minimize the users perception of sluggish performance.

If youre doing more than painting in your OnPaint code, you really need to rethink your design, what and how your doing, and why you need to do it this way. The events structure is very rigid, with Windows expecting each window event handler to do very specific things. Wander outside of those expectations and you'll end up with very strange, or at the least, very poor behavior/performance.


RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralRe: Event Queuing Question Pin
paulsawyer20-Apr-05 5:19
paulsawyer20-Apr-05 5:19 
GeneralRe: Event Queuing Question Pin
Dave Kreskowiak20-Apr-05 17:16
mveDave Kreskowiak20-Apr-05 17:16 
GeneralRe: Event Queuing Question Pin
paulsawyer21-Apr-05 7:11
paulsawyer21-Apr-05 7:11 
Generaldraw text in .NET Framework control Pin
Anonymous15-Apr-05 23:45
Anonymous15-Apr-05 23:45 
GeneralRe: draw text in .NET Framework control Pin
MoustafaS16-Apr-05 11:49
MoustafaS16-Apr-05 11:49 
GeneralRe: draw text in .NET Framework control Pin
Anonymous17-Apr-05 20:31
Anonymous17-Apr-05 20:31 
GeneralRe: draw text in .NET Framework control Pin
MoustafaS18-Apr-05 12:27
MoustafaS18-Apr-05 12:27 
GeneralFinally here!! Pin
Johnathon Dupuis15-Apr-05 16:41
Johnathon Dupuis15-Apr-05 16:41 
GeneralUnmanaged dll in Pocket PC 2002. Pin
Anonymous15-Apr-05 5:51
Anonymous15-Apr-05 5:51 
GeneralRe: Unmanaged dll in Pocket PC 2002. Pin
Mike Dimmick15-Apr-05 8:11
Mike Dimmick15-Apr-05 8:11 
GeneralInstalled fonts in .NET Compact Framework Pin
Anonymous15-Apr-05 5:46
Anonymous15-Apr-05 5:46 
GeneralRe: Installed fonts in .NET Compact Framework Pin
Mike Dimmick15-Apr-05 8:29
Mike Dimmick15-Apr-05 8:29 
GeneralMicrosoft Reporting Service Pin
sukasukabo15-Apr-05 1:49
sukasukabo15-Apr-05 1:49 
GeneralRe: Microsoft Reporting Service Pin
Anonymous17-Apr-05 18:16
Anonymous17-Apr-05 18:16 
General.NET dependencies Pin
Anonymous15-Apr-05 0:38
Anonymous15-Apr-05 0:38 
GeneralRe: .NET dependencies Pin
Sebastian Schneider15-Apr-05 3:42
Sebastian Schneider15-Apr-05 3:42 
GeneralRe: .NET dependencies Pin
Luis Alonso Ramos16-Apr-05 19:09
Luis Alonso Ramos16-Apr-05 19:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.