WPF printing multiple elements in the visual tree of a window -
i have wpf window contains 3 items controls, along 3 buttons. there way using printvisual() can print 2 of items controls, , no buttons?
my first thought dynamically create stackpanel , add controls wanted print it, can't without detaching them first , seems problematic.
i use printvisual because it's simple. (unfortunately can't spend time on application).
***please forgive lack of source code supplied, i'm relatively new wpf , form grotesquely over-coded. guess i'm curious if there simple solution out there.
thanks.
if concern printing part of page. place 2 items controls want print inside grid element. give name
<grid x:name="printgrid"> .... </grid>
then can call printdialog.printvisual like
printdialog printdialog = new printdialog(); printdialog.printvisual(printgrid,"the description");
if cannot manage group controls own grid manually creating container in code , adding existing named itemscontrols them. can printvisual container.
Comments
Post a Comment