在多行文本框中输入光标位置. [英] FInding the cursor position in muliti line textbox.
本文介绍了在多行文本框中输入光标位置.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个用于地址的多行文本框和一个具有四个值(房屋编号,镇,区域,街道)的列表框,它们可以用作智能感知,这意味着在多行文本框上按ctrl按钮时,该列表框将像智能感知一样打开C#中的intellisense,问题是当我选择任何值(例如house#),然后按ctrl按钮时,在house#开头打开的intellisense表示在h处,而不是在#号处.
我的代码是那个
i have a multi line text box for address and a listbox that have four values(house#, town,area,street) that work as intellisense, mean when on multi line textbox i press ctrl button the listbox open as intellisense like intellisense in c#, the problem is that when i select any value e.g house# and then press ctrl button the intellisense open at the start of house# mean at h, not at #.
my code is that
CurrentTagStart = txtDetailAddress.SelectionStart;
Point p = txtDetailAddress.GetPositionFromCharIndex(CurrentTagStart);
p.X = txtDetailAddress.TextLength;
Console.WriteLine((int)txtDetailAddress.Font.GetHeight());
lbIntelli.Location = new Point(txtDetailAddress.Location.X.p.X, txtDetailAddress.Location.Y);
lbIntelli.Show();
ActiveControl = lbIntelli;
推荐答案
这可能对您有帮助:
文本框光标位置 [
This might help you:
TextBox cursor position[^]
这篇关于在多行文本框中输入光标位置.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文