回复 1楼fenghud的帖子
请使用以下代码测试:
- private void replaceToolStripMenuItem_Click(object sender, EventArgs e)
- {
- this.textControl1.Select(0, this.textControl1.InputPosition.TextPosition);
- string spaces = this.textControl1.Selection.Text;
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < spaces.Length; i++)
- {
- sb.Append(' ');
- }
- this.textControl1.Selection.Text = sb.ToString();
-
- }
复制代码 |