通过以下设置可以实现你的需求,设置文档为不能编辑,当进入TextField时设置为可编辑,当离开TextField时设置为不能编辑:
- private void Form1_Load(object sender, EventArgs e)
- {
- textControl1.EditMode = TXTextControl.EditMode.ReadAndSelect;
- }
- private void textControl1_TextFieldEntered(object sender, TXTextControl.TextFieldEventArgs e)
- {
- textControl1.EditMode = TXTextControl.EditMode.Edit;
- }
- private void textControl1_TextFieldLeft(object sender, TXTextControl.TextFieldEventArgs e)
- {
- textControl1.EditMode = TXTextControl.EditMode.ReadAndSelect;
- }
复制代码 |