Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WM_PAINT Handler For VBA Form 2

Status
Not open for further replies.

YerMom

Programmer
Oct 3, 2006
127
US
Hello,

I'm using VBA within Word and have a form on which I draw graphics such as lines and ellipses.

However, (unlike regular VB) because there is no built-in handler for the WM_PAINT message, my graphics disappear when my form is hidden by another window.

Is there anyway to code my own event handler for the WM_PAINT message?

Thanks very much.
 
This is way out of my knowledge base, but could you use RDW_INTERNALPAINT with the UserForm_Activate() event? Or perhaps _Click? Mind you _Click would not fire if only the title bar is clicked. You have to click the userformitself.

When you say "hidden", do you mean by switching to another application, which covers the userform?

Gerry
My paintings and sculpture
 
Have you tried to play with the Repaint method of the UserForm object ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks fumei and merci bien, PHV. I'll check into both suggestions and let you know what I find out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top