Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

  • Leaders
Posted

Have you tried calling DrawToBitmap on the form?

 

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

Controls inside containers are rendered in reverse order.[/Quote]
[sIGPIC]e[/sIGPIC]
Posted
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.

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...