Jump to content
Xtreme .Net Talk

Recommended Posts

  • Administrators
Posted

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.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...