paul has a real good example for that.īut now this is 270 text boxes on a single form and that is what is scrolling? But I am not sure if that will get the covered part of the control. ie have a panel (maybe picturebox) that scrolls then print the panel. I think maybe you want to control.drawtobitmap then you print that bitmap. You need to loop the device properties and get the exact name and then spec that tray. You can set the tray source similar to how I did the paper size. Maybe someone else has an example or you can find one its a common problem? I don't recall the solution for sure. So you will have to learn how to use the printer a little bit. Well I dont have an example already made for that. If ratio > e.MarginBounds.Width / e.MarginBounds.Height ThenĬInt(e.MarginBounds.Top + (e.MarginBounds.Height / 2) - ((e.MarginBounds.Width / ratio) / 2)),ĬInt(e.MarginBounds.Left + (e.MarginBounds.Width / 2) - (e.MarginBounds.Height * ratio / 2)),Ģ - It only prints default form size (the part below where I scroll to at bottom of form is not show even in preview." 'draw the form image on the printer graphics sized and centered to marginsĭim ratio As Single = CSng(bmp.Width / bmp.Height) Me.DrawToBitmap(bmp, New Rectangle(0, 0, Me.Width, Me.Height)) Using bmp As Bitmap = New Bitmap(Me.Width, Me.Height) 'create a memory bitmap and size to the form Private Sub OnPrintPage(ByVal sender As Object, ByVal e As ) Pd.DefaultPageSettings.PaperSize = New PaperSize("A3", 1169, 1654)ĪddHandler pd.PrintPage, AddressOf OnPrintPage Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.LoadīackgroundImage = Image.FromFile("c:\bitmaps\rusty.jpg")ĭim pd As New Code: 'prints form fit to page and centered with preview set page size to a3
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |