急!!光标处插入值

kyoo_1985 2007-05-13 05:04:10
在C#中我有一个RichEditBox,现在想在这个RichEditBox的光标处插入值。

就是我先在RichEidtBox的一个位置吧鼠标定位了,然后点旁边的地方把一个值插入到指定的这个位置!

这是到底是什么属性或者方法!

急!!
...全文
245 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaolinpeng 2007-05-15
  • 打赏
  • 举报
回复
If I were you, I would probably implement my own RichTextBox:

class MyRichTextBox : RichTextBox
{
private int insertPosition;
public int InsetPosition
{
get{}
set{}
}
}

then handle the MOUSE BUTTON UP event to get the current mouse cusor position and set it to InsertPosition. Now you know where to insert your data.
-过客- 2007-05-15
  • 打赏
  • 举报
回复
这个效果吗?

richTextBox1.SelectedText += "your text";
trainli 2007-05-15
  • 打赏
  • 举报
回复
richTextBox.SelectionStart
holydiablo 2007-05-14
  • 打赏
  • 举报
回复
richTextBox.SelectionStart

17,740

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 .NET Framework
社区管理员
  • .NET Framework社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧