Little help please

  • Thread starter Thread starter ErUs
  • Start date Start date
E

ErUs

Im having real trouble painting to my document uotside of the Paint()
event.
could someone please post some code to show me how.
 
ErUs said:
Im having real trouble painting to my document uotside of the Paint()
event. could someone please post some code to show me how.

The questions that work best in this medium are specific rather than the
overly broad question you posted.

Why not repost the question by saying what you are using - .Net/MFC/SDK,
what you have tried and how it failed?

Regards,
Will
 
its a .net forms app in C++ ,
the problem is that i cant paint to a window unless its inside an
event like e->paint blah blah
 
You are supposed to do your painting inside the Paint event, or the OnPaint
& OnPaintBackground overrides.

Have a look at http://www.bobpowell.net/faqmain.htm for info on GDI.NET.

ErUs said:
Im having real trouble painting to my document uotside of the Paint()
event.
could someone please post some code to show me how.
 
ErUs said:
its a .net forms app in C++ ,
the problem is that i cant paint to a window unless its inside an
event like e->paint blah blah

Reminds me of a line from the movie Cool Hand Luke - "What we have here is a
failure to communicate."

Is it that you don't know how or that something you have tried fails?

Do you know that outside the paint event handler you can call
CreateGraphics() to get an used to paint a control like the one you get
inside a paint event handler?

In any case, WinForms is neither my specialty nor the subject of this group.
You may want to post again in one of the

microsoft.public.dotnet.framework.windowsforms

groups.

Regards,
Will
 
ErUs said:
its a .net forms app in C++ ,
the problem is that i cant paint to a window unless its inside an
event like e->paint blah blah

Correct - you're not supposed to. You CAN use CreateGraphics, as William's
said, but it's best to call Invalidate and do any drawing in OnPaint.
Otherwise you'll almost certainly get overdrawn when a Paint event is sent
to the control / form.

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top