vb.net - VB .NET WinFormApplication Printing Failed Landscape mode after setting -


i using vb .net programming , print winformsapplication in landscape mode portrait mode not fit properly.

i have set landscape mode true. may refer code below:

    private sub printall_click(byval sender object, byval e system.eventargs)      handles printall.click     printform1.form = me     printdocument1.defaultpagesettings.landscape = true     printform1.print(me, powerpacks.printing.printform.printoption.fullwindow)     printdialog1.showdialog()     end sub 

and result shown below in screenshot http://s335.photobucket.com/user/blakeex/media/notcomplete.png.html share hint or guides?

to print complete client area of scrollable form, if form has been resized.

try printform1.print(me, powerpacks.printing.printform.printoption.scrollable)

here's way print whatever part of form viewable on screen:

private sub button3_click(byval sender system.object, byval e system.eventargs) handles button3.click     capturescreen()     printdocument1.defaultpagesettings.landscape = true     printdocument1.defaultpagesettings.margins = new printing.margins(0, 0, 0, 0)     printdocument1.print() end sub dim memoryimage bitmap private sub capturescreen()     dim mygraphics graphics = me.creategraphics()     dim s size = me.size     memoryimage = new bitmap(s.width, s.height, mygraphics)     dim memorygraphics graphics = graphics.fromimage(memoryimage)     memorygraphics.copyfromscreen(me.location.x, me.location.y, 0, 0, s) end sub private sub printdocument1_printpage(byval sender system.object, byval e system.drawing.printing.printpageeventargs) handles printdocument1.printpage     dim pagerec new rectanglef(e.pagesettings.printablearea.x, e.pagesettings.printablearea.y, e.pagesettings.printablearea.height, e.pagesettings.printablearea.width)     e.graphics.drawimage(memoryimage, pagerec, new rectangle(me.location, me.size), graphicsunit.pixel) end sub 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -