any one knows how to print a Picturebox with controls in it?
Hi all
I scroll the forum for a quick and simple answer about printing a picturebox with any control in it ,Well i was supprise and shock
that there was nothing clear and easy to use .
Any idea before i get sick?
It works The picturebox with the controls in it appear smaller then at the screen what do i need to change ,the picture scalemode or something in your code?
If CommonDialog1.FileName <> vbNullString Then SavePicture Picture2.Image, CommonDialog1.FileName
End Sub
This will work if Picture1 is 100% visible when you press the button, example: if the user moved the Form and the picture is half visible, only that half will be saved.
If CommonDialog1.FileName <> vbNullString Then SavePicture Picture2.Image, CommonDialog1.FileName
End Sub
This will work if Picture1 is 100% visible when you press the button, example: if the user moved the Form and the picture is half visible, only that half will be saved.
Re: any one knows how to print a Picturebox with controls in it?
jcis, the code works; however when i put the common dialog on frmMain, it disables my user control, so I put the code into another form and when I did that, it saves correctly but then that form is on top of the screen shot. any way i can take the other form away? this is what i mean (screen shot attached)
Re: any one knows how to print a Picturebox with controls in it?
Originally Posted by jcis
Could you upload your project?
i have found that if you add a common dialog control or an image list to the form that has a user control, the user control no longer works. the user control i am using is to resize and move the controls that are added to the picturebox container at run-time. that is why i have to put the common dialogs on different forms which suck badly. i also want to add icons to my menu editor but you cant do that if the image list isnt on the same form, ugh. complete project attached.
frmMain is my main form, and frmSaveAsImage is where your code is located. I also put the BitBlt stuff in a module, just in case i need to use it again.
Last edited by BrailleSchool; Aug 7th, 2006 at 05:12 PM.
Re: any one knows how to print a Picturebox with controls in it?
yep, that worked perfectly. thanks jcis.
question:
i am using initdir to specify the default directory to open, sometimes the directory specified isnt the defaulted (sometimes opens somewhere else, but not often), how can i get it to always be the default?