printform messes with zorder!

t3hpimpz0r

Newcomer
Joined
Aug 19, 2010
Messages
2
I'm having a really annoying issue.

I have a form that has several panels on it, and the innermost panel has a picturebox in it with a few labels on top. It looks fine when I look at the form.

When I use the printform control to print the form, however, for some dumb reason the picturebox gets sent to the front and it covers all the labels! Even if do picturebox1.sendtoback right before I call the print method, it's still on top. It's so frustrating! Just stay back there, please.

I realize that I have the option to draw an image of the form and print that, but unfortunately this program is massive and that makes it take so much longer. Also, I need this to pretty much open a form, print it, and close it really fast. My attempts at capturing the image of the form have been unsuccessful because the form loads only halfway, the 'document is being sent to printer....' dialog pops up from windows, that gets captured along with the partially loaded form, and then that jumbled mess is printed. Also, other forms are constantly coming forward and stuff, so capturing the screen isn't full proof at all. The printform would be absolutely perfect if it just didn't screw with my zOrder. Please tell me someone has a solution.

Thanks.
 
Have you tried calling DrawToBitmap on the form?

I did notice this questionable note in the remarks on MSDN:


Thanks for the reply. Had no need for that function, cause you pointing out "reverse order" led me to try reversing the order of the zorders and print how I have been. It worked! Apparently printform prints in reverse zorder. Why? I have no idea, but I'm glad we got this taken care of.

Thanks again.
 
Back
Top