technofantasy
博客园
首页
新随笔
联系
订阅
管理
22 Posts :: 16 Stories :: 64 Comments :: 1 Trackbacks
与我联系
发短消息
搜索
常用链接
我的随笔
我的空间
我的短信
我的评论
更多链接
我的参与
我的新闻
最新评论
我的标签
留言簿
(22)
给我留言
查看留言
我参与的团队
北京.NET俱乐部(0/1448)
湖南.NET俱乐部(0/603)
Office专业开发团队(0/65)
MVP(微软最有价值专家)团队(1/541)
随笔分类
ASP.NET(2)
Atlas研究
RichTextBox技巧(5)
VB 2005写作进度(2)
VB.NET(1)
杂类(12)
随笔档案
2008年6月 (1)
2008年5月 (1)
2007年3月 (2)
2006年12月 (1)
2006年10月 (3)
2006年9月 (6)
2006年8月 (2)
2006年7月 (4)
2006年1月 (1)
2005年12月 (1)
文章分类
ASP.NET(3)
Atlas研究(2)
Merlion(2)
VB.NET(1)
Visual Basic(1)
VSTO(1)
Webcasts(6)
相册
Microsoft visual studo 2008巡展长沙站
VB.NET
朋友的BLOG
发条木偶的Blog
美女苏胖墩的BLOG
我的网站
AppleVB
最新评论
1. re: 为Office 2007添加自定义面板(Custom Pane)
不必要那么麻烦的,这样不是很简单吗???
--Falepose
2. re: 为Office 2007添加自定义面板(Custom Pane)
#region 浮动面板管理 private Dictionary<string, CustomTaskPane> customTaskPaneDicti...
--Falepose
3. re: 微软社区发布会总结(多图杀猫)
看得的确辛苦
--萧寒
阅读排行榜
1. 在VB.NET中如何使在Webbrowser中实现标签页中打开新链接(2425)
2. 运行cl.exe编译发生:没有找到 mspdb80.dll 的解决办法(2298)
3. 如何使得ShowModalDialog打开的页面自动刷新(1510)
4. RichTextBox技巧之插入表格(转载)(714)
5. RichTextBox技巧之插入图片(转载)(649)
评论排行榜
1. 湖南微软开发者俱乐部成立大会顺利召开(20)
2. VB 2005的写作进度(9)
3. 微软社区发布会总结(多图杀猫)(6)
4. 让微软出钱捐助难民吧(5)
5. 湖南微软.NET俱乐部 成立大会事宜(4)
RichTextBox技巧之插入带格式文本(转载)
visual basic code:
Dim
iPos
As
Long
Dim
strInsert
As
String
Dim
strRTF
As
String
Dim
lStart
As
Long
'
assumes that strInsert contains the RTF code that you want to insert
'
and that the current cursor position is where you want it selected
With
RichTextBox1
'
mark the current insertion point with special characters
.SelText
=
Chr
(
&
H9D)
&
Chr
(
&
H81)
'
get the rtf text into our variable
strRTF
=
.TextRTF
'
insert our text at the insertion point
strRTF
=
Replace
(.TextRTF,
"
\'9d
"
, strInsert)
.TextRTF
=
strRTF
'
now find the end of the insertion
lStart
=
.Find(
Chr
(
&
H81))
'
get rid of the other character
strRTF
=
Replace
(.TextRTF,
"
\'81
"
,
""
)
.TextRTF
=
strRTF
'
position the cursor after the insertion
.SelStart
=
lStart
End
With
posted on 2006-09-06 17:06
陈锐
阅读(314)
评论(0)
编辑
收藏
所属分类:
RichTextBox技巧
社区
新闻
新用户注册
刷新评论列表
标题
姓名
主页
Email
(只有博主才能看到)
验证码
*
看不清,换一张
[
登录
][
注册
]
内容(请不要发表任何与政治相关的内容)
Remember Me?
登录
使用高级评论
新用户注册
返回页首
恢复上次提交
[使用Ctrl+Enter键可以直接提交]
所属分类的其他文章:
·
RichTextBox技巧之插入图片(转载)
·
RichTextBox技巧之插入表格(转载)
·
RichTextBox技巧之插入上标和下标(转载)
·
RichTextBox技巧之显示自定义高亮显示(转载)
·
RichTextBox技巧之插入带格式文本(转载)
最新IT新闻:
·
微软高价聘请喜剧天王拍广告
·
2008年8月22日IT博客精选
·
微软封杀盗版网站
·
财富:十大最炫酷的手机应用软件
·
商业周刊:暴雪Activision合并 巨无霸诞生
博客园新闻频道
博客园首页
社区
Powered by:
博客园
Copyright © 陈锐