Exemplo n.º 1
0
 private void setListBoxPoints()
 {
     if (listBoxPoints.Items.Count > 0)
     {
         listBoxPoints.Items.Clear();
     }
     listBoxPoints.Items.AddRange(ListPointDesc.ToArray());
     SetEnabledBtnDeletePoint();
 }
Exemplo n.º 2
0
 private void ClearListPoints_Click(object sender, EventArgs e)
 {
     if (ListPoints.Count > 0 && ListPointDesc.Count > 0)
     {
         ListPoints.Clear();
         ListPointDesc.Clear();
         setListBoxPoints();
     }
 }
Exemplo n.º 3
0
 private void DeleteSelectPoint_Click(object sender, EventArgs e)
 {
     if (listBoxPoints.Items.Count > 0 && listBoxPoints.SelectedIndex > -1)
     {
         ListPoints.RemoveAt(listBoxPoints.SelectedIndex);
         ListPointDesc.RemoveAt(listBoxPoints.SelectedIndex);
         setListBoxPoints();
     }
     else if (listBoxPoints.Items.Count > 0 && listBoxPoints.SelectedIndex == -1)
     {
         ListPoints.RemoveAt(0);
         ListPointDesc.RemoveAt(0);
         setListBoxPoints();
     }
 }
Exemplo n.º 4
0
        private void AddPoint_Click(object sender, EventArgs e)
        {
            if (GetPointY.Length > 0 && GetPointX.Length > 0)
            {
                int x = Int32.Parse(GetPointX);
                GetPointX = "";
                int y = Int32.Parse(GetPointY);
                GetPointY = "";
                int[] point = { x, y };

                ListPoints.Add(point);
                ListPointDesc.Add($"Вершина с координатой: {x}; {y}");

                setListBoxPoints();
            }
        }