锐英源软件
第一信赖

精通

英语

开源

擅长

开发

培训

胸怀四海 

第一信赖

当前位置:锐英源 / 英语翻译 / ICSharpCode.TextEditor / 光标位置
服务方向
人工智能数据处理
人工智能培训
kaldi数据准备
小语种语音识别
语音识别标注
语音识别系统
语音识别转文字
kaldi开发技术服务
软件开发
运动控制卡上位机
机械加工软件
软件开发培训
Java 安卓移动开发
VC++
C#软件
汇编和破解
驱动开发
联系方式
固话:0371-63888850
手机:138-0381-0136
Q Q:396806883
微信:ryysoft

How could I display current Carret Pos in StatusBar? 我怎么能在状态栏显示当前光标位置呢?

The code to show current caret pos is
stLabEditor1.Text = string.Format("L:{0}, C:{1}", txtSql.ActiveTextAreaControl.Caret.Line + 1, txtSql.ActiveTextAreaControl.Caret.Column + 1);
显示当前光标位置的代码是

stLabEditor1.Text = string.Format("L:{0}, C:{1}", txtSql.ActiveTextAreaControl.Caret.Line + 1, txtSql.ActiveTextAreaControl.Caret.Column + 1);

But the problem is - on which event should I put a call of this code?! That is really the big question.
I have tried lot of events but all of them do not work as expected.
It seems KeyDown/KeyPress/KeyUp and MouseDown/MouseUp events does not work at all for this control.

但问题是——应该在哪个事件里把这段代码调用? !这是真正的大问题。我尝试过很多事件,但它们不像预期的那样工作。

似乎KeyDown /KeyPress/KeyUp 和MouseDown / MouseUp事件不受控制。
So, I set handlers for most of events and put breakpoints in all handlers. There were no calls at all! Only "TextChanged" called a handler, but there were no calls to keyboard and mouse events.

所以,我设置事件处理程序的大部分时间里,把断点设置在所有处理程序。没有调用!只有“TextChanged”调用了一个处理方法,但没有键盘和鼠标事件和调用。

I do not want to use timer to display caret pos. I think that is silly to use timer for such things. I would like to use some event from this control.
我不想使用计时器显示插入符号pos。我认为这是一个笨的方法。我想用一些事件的控制。

Could you please advise something on it?请问你有什么建议么?

Have you tried subscribing to TextArea.Caret.PositionChanged 你尝试订阅TextArea.Caret.PositionChanged吗?

Aha. I thought it should be available in design-time, so I missed it. Thank you for hint. It works fine now.

哦。我认为这应该只是在设计状态里才能用,所以我把它给忘了。谢谢你的提示。现在工作正常。

友情链接
版权所有 Copyright(c)2004-2024 锐英源软件
统一社会信用代码:91410105098562502G 豫ICP备08007559号 最佳分辨率 1440*900
地址:郑州市金水区文化路97号郑州大学北区院内南门附近