ScintillaNet - 计算出用户点击了哪一行

发布于 2024-08-26 09:17:25 字数 218 浏览 14 评论 0原文

我正在使用 ScintillaNet 文本框控件来显示一些搜索结果,我希望能够检测到当用户双击/右键单击结果中的一行时,以便我可以找出他们正在单击的点击。

有人对这样做的最佳方法有任何想法吗?我可以想到几种方法,但对我来说它们似乎都有点“hacky”。

I'm using the ScintillaNet text box control to display some search results and I want to be able to detect when the user double clicks / right clicks on a line in the results so that I can work out which hit they are clicking on.

Does anyone have any ideas on the best way of doing this? I can think of a few ways but they all seem a bit "hacky" to me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

青春如此纠结 2024-09-02 09:17:25

要从光标位置获取行号,您可以使用类似的方法

scintilla1.Lines.FromPosition(scintilla1.CurrentPos).Number

to get the line number from cursor position, you could use something like this

scintilla1.Lines.FromPosition(scintilla1.CurrentPos).Number
初心未许 2024-09-02 09:17:25

使用新版本的 ScintillaNET 您可以使用更好的函数来获取当前行号:

scintilla1.Lines.Current.Number()

我能够将事件处理程序附加到 SelectionChanged 事件,然后获取当前行号来执行您所要求的操作。

With the new version of ScintillaNET you can use a better function to get the current line number:

scintilla1.Lines.Current.Number()

I was able to attach an event handler to SelectionChanged event and then, get the current line number to do what you've asked.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文