在Richedit控件中移动光标 [英] Move cursor in Richedit control

查看:154
本文介绍了在Richedit控件中移动光标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

我正在使用RichEdit控件,因此当我粘贴以下代码时,光标必须直接转到该位置并在Rich Edit控件中编写一些文本.因此,请提出建议,并提供一些示例代码.

23H,10 CodeProject:光标必须移至第23行和第10列,并且需要编写如图所示的文本..在RichEdit Control中.

在此先感谢所有编码人员..

问候
山姆

(注意:我已经尝试使用GetSel,SetSel,GetCaretPos,SetCaretPos解决了我的问题).

Hi All!!

I''m Working on RichEdit Control, so when i paste the below code, cursor has to go directly to that location and write some text in rich edit control. So please suggest, and provide some sample code.

23H,10 CodeProject : Cursor has to go 23rd row and 10th column and need to write the text like shown.... In RichEdit Control.

Thanks in advance to all coders..

Regards
Sam

(Note: I have tried with GetSel,SetSel,GetCaretPos, SetCaretPos not solved my problem)

推荐答案

这都是在原始Windows API中实现的,但无法通过以下方式访问单独的功能,但通过Windows消息.您可以将发送的带有计算的消息包装到列出的函数中.消息类似于EM_LINEFROMCHAREM_LINEINDEX等.您将在这里找到它们:
http://msdn.microsoft.com/zh-我们/library/windows/desktop/bb761611%28v=vs.85%29.aspx [ http://social.msdn.microsoft.com /Forums/zh-CN/vcgeneral/thread/fc292bcc-ccaf-4ef4-bdf0-1480b0a9f492/ [
It is all implemented in raw Windows API, but is accessible not through separate functions but through Windows messages. You can wrap sending appropriate messages with calculations into the functions you''ve listed. The messages are like EM_LINEFROMCHAR, EM_LINEINDEX and others. You will find them here:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb761611%28v=vs.85%29.aspx[^].

See also this discussion:
http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/fc292bcc-ccaf-4ef4-bdf0-1480b0a9f492/[^].

—SA


这篇关于在Richedit控件中移动光标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆