nisnfox 你好,
可以通过获取当前点击 TextField 第一个字符的 InputPosition 去获取 Point:
- private void textControl1_TextFieldClicked(object sender, TXTextControl.TextFieldEventArgs e)
- {
- //获取当前点击 TextField
- TXTextControl.TextField currentTextFiled = e.TextField;
- //获取当前行、列及 Page 索引
- int currentPageIndex=this.textControl1.InputPosition.Page;
- int startPositionX = currentTextFiled.Start;
- int startPositionY = this.textControl1.InputPosition.Line;
- //根据索引创建 InputPosition
- TXTextControl.InputPosition startPosition=new TXTextControl.InputPosition(currentPageIndex ,startPositionX ,startPositionY );
- //通过 ImputPostion 获取当前点击 TextField Point
- Point editorLocation = startPosition.Location;
- }
复制代码 |