会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
chun0318
博客园
新随笔
管理
上一页
1
2
2012年5月30日
WPF RichtextBox中加载Rtf字段
摘要: MemoryStream stream = new MemoryStream(ASCIIEncoding.Default.GetBytes((string)rtf)); mRichTextBox.Selection.Load(stream, DataFormats.Rtf);
阅读全文
posted @ 2012-05-30 17:24 chun0318
阅读(438)
评论(0)
推荐(0)
2012年5月15日
wpF布局容器添加滚动条
摘要: 把布局容器添加到ScrollViewer中,可以实现布局容器滚动的效果:代码如下:Canvas tCanvas = new Canvas; m_ScrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Disabled;m_ScrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;m_ScrollViewer.Width = 150;m_ScrollViewer.Height = tHeight;m_ScrollViewer....
阅读全文
posted @ 2012-05-15 18:40 chun0318
阅读(1726)
评论(0)
推荐(0)
wpf呈现UIElment的缩略图
摘要: 在msdn上面介绍两种方法:1、使用RenderTargetBitmap2、使用VisualBrush使用第一种方式是,首先按UIElement的原始尺寸转换成位图,放到Image控件里面,通过缩放矩阵编写你想要的缩略图,代码: 1 RenderTargetBitmap tRenderTargetBitmap = new RenderTargetBitmap((int)tPageNode.Width, (int)tPageNode.Height, 1 / 96, 1 / 96, PixelFormats.Default); 2 tRenderTa...
阅读全文
posted @ 2012-05-15 16:18 chun0318
阅读(2076)
评论(0)
推荐(0)
在Button上面显示图片,去掉Button的默认样式
摘要: <Window.Resources> <Style x:Key="ButtonStyle"> <Setter Property="Button.Width" Value="35"/> <Setter Property="Button.Height" Value="35"/> <Setter Property="Button.Margin" Value="3,0,0,0"/> </Style&
阅读全文
posted @ 2012-05-15 09:27 chun0318
阅读(1992)
评论(0)
推荐(0)
2012年5月9日
WPF RichTextBox的Document属性的序列化与反序列化
摘要: 序列化: string strDocument = System.Windows.Markup.XamlWriter.Save(m_RichTextBox.Document);保存成字符串的形式反序列化:System.IO.StringReader tStringReader = new System.IO.StringReader((string)e.Value); //其中e.Value是序列化中的stringSystem.Xml.XmlReader tXmlReader = System.Xml.XmlReader.Create(tStringReader);FlowDocume...
阅读全文
posted @ 2012-05-09 09:44 chun0318
阅读(478)
评论(0)
推荐(1)
上一页
1
2