ThePentiumGuy Posted July 4, 2004 Posted July 4, 2004 whats the difference between these 2? Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
Administrators PlausiblyDamp Posted July 4, 2004 Administrators Posted July 4, 2004 Paint is the event in which a consumer of your control (form etc containing your control) can react to your control drawing itself. Paint is an Event and as such requires an event handler (delegate) to be connected. OnPaint is a method rather than an event - you would normally override the OnPaint method in a control if you are inheriting from a parent control (nearly always the case as you would normally inherit from Control or a derivative of Control), performing the relevant drawing code there. If you are using OnPaint then calling base.OnPaint will call all the base class' drawing code and invoke any attached event handlers. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
ThePentiumGuy Posted July 5, 2004 Author Posted July 5, 2004 oh so basically with Paint, if you (for example) resize the form, it'll redraw itself automatically whereas with OnPaint, it wouldn't do this becuase it wouldn't 'react to the conrol drawint itself'? pent Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.