How to print the contents of a TextBox

后端 未结 3 635
臣服心动
臣服心动 2021-01-04 05:29

How do I print the contents of a TextBox in metro apps? I have read this quickstart guide on MSDN and many online tutorials, but they are very complicated and do not

3条回答
  •  情歌与酒
    2021-01-04 05:57

    UPDATE 1

    I have created a helper class which simplifies printing text box content. You can add helper class via NuGet. If you want to enhance my existing helper class, fork on GitHub


    Here I am giving you the modified print sample from MSDN. I have put textbox you can write anything and that will be printed. Please note I have not done sample which prints textbox text exactly same as it is i.e formatting (bold, italic, underline, colors). I have set hard-coded print format. You can make your own format.

    Stack Overflow has character limit in answer and my code is too long so posting CodePaste.net links.

    XAML : http://codepaste.net/9nf261

    CS : http://codepaste.net/q3hsm3

    Please note that I have used some images so put images in "Images" folder

提交回复
热议问题