您的位置:首页 > 编程语言

Live writer 2011, 代码染色测试

2010-10-12 22:07 127 查看
PrintPreview cw = new PrintPreview();
cw.ShowPreview(rtb);
cw.HasCloseButton = false;

//Hook up a handler to the Closed event before we display the PrintPreview window by calling the Show() method.
cw.Closed += (t, a) =>
{
if (cw.DialogResult.Value)
{
PrintDocument theDoc = new PrintDocument();
theDoc.PrintPage += (s, args) =>
{
args.PageVisual = rtb;
args.HasMorePages = false;
};

theDoc.EndPrint += (s, args) =>
{
MessageBox.Show("The document printed successfully", "Text Editor", MessageBoxButton.OK);
};

theDoc.Print("Silverlight 4 Text Editor");
ReturnFocus();
}
};
cw.Show();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: