Ejemplo n.º 1
0
 /// <summary>
 /// 添加应急联动的窗体
 /// </summary>
 /// <param name="jsonStr">jsonStr</param>
 private void AddForm(string jsonStr = "")
 {
     try
     {
         GraphDrawing form;
         if (string.IsNullOrWhiteSpace(jsonStr))
         {
             form = new GraphDrawing();
         }
         else
         {
             form = new GraphDrawing(jsonStr);
         }
         form.FormBorderStyle = FormBorderStyle.None;
         form.MaximizeBox     = false;
         form.MinimizeBox     = false;
         form.TopLevel        = false;
         form.ControlBox      = false;
         form.WindowState     = FormWindowState.Normal;
         form.Visible         = true;
         form.Dock            = DockStyle.Fill;
         if (groupControlForm.Controls.Count > 0)
         {
             GraphDrawing itemForm = groupControlForm.Controls[0] as GraphDrawing;
             itemForm.Close();
             itemForm.Dispose();
         }
         groupControlForm.Controls.Add(form);
     }
     catch (Exception ex)
     {
         LogHelper.Error(ex.Message);
     }
 }
Ejemplo n.º 2
0
 private void SetEmergencyLinkage_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (groupControlForm.Controls.Count > 0)
     {
         GraphDrawing itemForm = groupControlForm.Controls[0] as GraphDrawing;
         itemForm.Close();
         itemForm.Dispose();
     }
 }