Ejemplo n.º 1
0
 /// <summary>
 /// 移除指定的状态栏中的条目
 /// </summary>
 public void RemovePanel(ref MapWinGIS.Interfaces.StatusBarItem panel)
 {
     if (panel == null)
     {
         return;
     }
     MapWinGIS.MainProgram.StatusBarItem item = panel as MapWinGIS.MainProgram.StatusBarItem;
     if (item != null)
     {
         for (int i = 0; i < this.StatusBar1.Items.Count; i++)
         {
             if (item.m_Item == this.StatusBar1.Items[i])
             {
                 this.RemovePanel(i);
                 return;
             }
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 按照索引的方式移除panel,但是必须存在一个panel
 /// </summary>
 /// <param name="index">以零为索引</param>
 public void RemovePanel(int index)
 {
     try
     {
         if (StatusBar1.Items.Count > index)
         {
             StatusBar1.Items.RemoveAt(index);
         }
         if (this.NumPanels == 0)
         {
             MapWinGIS.Interfaces.StatusBarItem item = this.AddPanel();
         }
     }
     catch (Exception ex)
     {
         Program.g_error = ex.ToString();
         Program.ShowError(ex);
     }
 }