Ejemplo n.º 1
0
 /// <summary>
 /// 增加一个线条对象
 /// </summary>
 /// <param name="Line"></param>
 public void AddLine(DataGridViewDrawLineInfo Line)
 {
     if (lines == null)
     {
         lines = new List <DataGridViewDrawLineInfo>();
     }
     lines.Add(Line);
     this.InvokePaint(this, new PaintEventArgs(this.CreateGraphics(), new Rectangle(0, 0, this.Width, this.Height)));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 移除一个线条对象
 /// </summary>
 /// <param name="Line"></param>
 public void RemoveLine(DataGridViewDrawLineInfo Line)
 {
     if (lines != null)
     {
         DataGridViewDrawLineInfo needRemoveLine = null;
         foreach (DataGridViewDrawLineInfo line in lines)
         {
             if (line.StartIndexOfRowColumn == Line.StartIndexOfRowColumn && line.EndIndexOfRowColumn == Line.EndIndexOfRowColumn &&
                 line.DrawLineOfRowColumnIndex == Line.DrawLineOfRowColumnIndex && line.DrawDirection == Line.DrawDirection)
             {
                 needRemoveLine = line;
                 break;
             }
         }
         if (needRemoveLine != null)
         {
             lines.Remove(needRemoveLine);
             this.InvokePaint(this, new PaintEventArgs(this.CreateGraphics(), new Rectangle(0, 0, this.Width, this.Height)));
         }
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 移除一个线条对象
 /// </summary>
 /// <param name="Line"></param>
 public void RemoveLine(DataGridViewDrawLineInfo Line)
 {
     if (lines != null)
     {
         DataGridViewDrawLineInfo needRemoveLine = null;
         foreach (DataGridViewDrawLineInfo line in lines)
         {
             if (line.StartIndexOfRowColumn == Line.StartIndexOfRowColumn && line.EndIndexOfRowColumn == Line.EndIndexOfRowColumn
                 && line.DrawLineOfRowColumnIndex == Line.DrawLineOfRowColumnIndex && line.DrawDirection == Line.DrawDirection)
             {
                 needRemoveLine = line;
                 break;
             }
         }
         if (needRemoveLine != null)
         {
             lines.Remove(needRemoveLine);
             this.InvokePaint(this, new PaintEventArgs(this.CreateGraphics(), new Rectangle(0, 0, this.Width, this.Height)));
         }
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 增加一个线条对象
 /// </summary>
 /// <param name="Line"></param>
 public void AddLine(DataGridViewDrawLineInfo Line)
 {
     if (lines == null)
         lines = new List<DataGridViewDrawLineInfo>();
     lines.Add(Line);
     this.InvokePaint(this, new PaintEventArgs(this.CreateGraphics(), new Rectangle(0, 0, this.Width, this.Height)));
 }