1、代码如下
- /// <summary>
- /// 删除内容记录
- /// </summary>
- /// <param name="empID">医生编号</param>
- /// <param name="empName">医生姓名</param>
- public void MedicalContentDel(int empID, string empName)
- {
- if (this.textControl.Selection.Length == 0x00)
- return;
- int currentLine = this.textControl.InputPosition.Line;
- int currentColumn = this.textControl.InputPosition.Column;
- int currentPage = this.textControl.InputPosition.Page;
- int start = this.textControl.Selection.Start;
- int length = this.textControl.Selection.Length;
- this.textControl.Selection.Strikeout = true;
- this.textControl.Selection.ForeColor = Color.Red;
- //痕迹保留,记录删除内容
- DeleteField delTextField = new DeleteField(this.textControl, this.textControl.Selection.Text, empID.ToString(), empName);
- this.textControl.Selection.Start = start;
- this.textControl.Selection.Length = length;
- this.textControl.Selection.ForeColor = Color.Black;
- this.textControl.Selection.Text = string.Empty;
- if (currentColumn == this.textControl.Lines[currentLine].Length || currentColumn == this.textControl.Lines[currentLine].Length - 1)
- {
- if (currentLine == this.textControl.Lines.Count)
- {
- this.textControl.InputPosition = new TXTextControl.InputPosition(currentPage, currentLine, currentColumn);
- }
- else
- {
- this.textControl.InputPosition = new TXTextControl.InputPosition(currentPage, currentLine + 1, 0);
- }
- }
- else
- {
- this.textControl.InputPosition = new TXTextControl.InputPosition(currentPage, currentLine, currentColumn + 1);
- }
- }
复制代码
2、执行以上代码效果如下:
111.jpg
(2.42 KB, 下载次数: 160)
|