12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace IntelligentControlForsx.Test
- {
- public partial class RefreshForm2 : Form
- {
- public RefreshForm2()
- {
- InitializeComponent();
- }
- private void btnChangeToMartix_Click(object sender, EventArgs e)
- {
- if (CacheForm.dicMain1Form.ContainsKey("mainForm1"))
- {
- RefreshForm f = (RefreshForm)CacheForm.dicMain1Form["mainForm1"];
- f.TopLevel = true;
- }
- if (CacheForm.dicMain2Form.ContainsKey("mainForm2"))
- {
- Form f = CacheForm.dicMain2Form["mainForm2"];
- //f.TopLevel = false;
- f.Hide();
- }
- }
- private void btnHome_Click(object sender, EventArgs e)
- {
- PageChange("home");
- }
- private void btnWindturbineInfo_Click(object sender, EventArgs e)
- {
- PageChange("info");
- }
- private void btnControl_Click(object sender, EventArgs e)
- {
- PageChange("control");
- }
- public void PageChange(string pageString)
- {
- IList<string> formKeyList = CacheForm.dicMain2Form.Keys.ToList();
- for (int i = 0; i < formKeyList.Count; i++)
- {
- Form f = CacheForm.dicMain2Form[formKeyList[i]];
- if (formKeyList[i] != "mainForm2")
- if (formKeyList[i] == pageString)
- f.Show();
- else
- f.Hide();
- }
- }
- }
- }
|