MFC RichEdit如何实现光标在行末时可以通过鼠标选择文本?

xyz01 2018-09-16 07:31:20
用MFC RichEdit做一个类似secureCRT的工具,如何实现插入符光标一直在行末闪烁同时可以通过鼠标选择文本?现在通过鼠标点击选择文本的时候命令行的光标就不见了。
象secureCRT的窗口中就可以让光标一直在命令输入处闪烁,同时可以操作鼠标选择前面已经输出的文本内容。
...全文
1469 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
schlafenhamster 2018-09-25
  • 打赏
  • 举报
回复
我的意思是 输入 用 另一个 edit
xyz01 2018-09-25
  • 打赏
  • 举报
回复
小方块光标和命令行提示符是在一行的。
schlafenhamster 2018-09-25
  • 打赏
  • 举报
回复
"下面小方块是插入符光标" 是 单独 一行 ?
xyz01 2018-09-25
  • 打赏
  • 举报
回复
可能前面说的不清楚,我要的效果是鼠标选择文本字符串到复制完文本,插入符光标都要在命令行位置闪烁。现状是鼠标选择文本时命令行的插入符光标就会跑到鼠标点击的位置去了。下图上面是crt中选择的文本,下面小方块是插入符光标。
schlafenhamster 2018-09-22
  • 打赏
  • 举报
回复
CWnd::ShowCaret
void ShowCaret( );

Remarks

Shows the caret on the screen at the caret’s current position. Once shown, the caret begins flashing automatically.

The ShowCaret member function shows the caret only if it has a current shape and has not been hidden two or more times consecutively. If the caret is not owned by this window, the caret is not shown.

Hiding the caret is cumulative. If the HideCaret member function has been called five times consecutively, ShowCaret must be called five times to show the caret.

The caret is a shared resource. The window should show the caret only when it has the input focus or is active.

xyz01 2018-09-21
  • 打赏
  • 举报
回复
ShowCursor()这个不是控制鼠标光标的吗?我说的光标是文本插入符光标。
shen_wei 2018-09-20
  • 打赏
  • 举报
回复
通过鼠标右键弹出的,右键菜单也可以。。

花丅鬼 2018-09-17
  • 打赏
  • 举报
回复
int ShowCursor(TRUE); 不起作用 ?
schlafenhamster 2018-09-16
  • 打赏
  • 举报
回复
int ShowCursor(TRUE); 不起作用 ?

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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