回复 1楼farmbrother的帖子
可以通过以下代码设置焦点离开 TextField:
- TextField tx;
- TextField tx1;
- private void Form1_Load(object sender, EventArgs e)
- {
- this.textControl1.Text = " ";
- tx = new TextField();
- tx.Text = "@TextField1@";
- tx.ShowActivated = true;
- tx.DoubledInputPosition=true;
- tx1 = new TextField();
- tx1.Text = "@TextField2@";
- tx1.ShowActivated = true;
- tx1.DoubledInputPosition=true;
- this.textControl1.TextFields.Add(tx);
- this.textControl1.TextFields.Add(tx1);
- }
- private void textControl1_Click(object sender, EventArgs e)
- {
- }
- private void setToolStripMenuItem_Click(object sender, EventArgs e)
- {
- textControl1.InputPosition = new InputPosition(tx.Start - 1, TextFieldPosition.OutsideTextField);
- }
复制代码 |