private void OpenSubForm <T>(CurrentSubForm subFromType) where T : Form { if (!currentSubForm[(int)subFromType]) { currentSubForm[(int)subFromType] = true; T SubForm = Activator.CreateInstance(typeof(T), new[] { this }) as T; SubForm.Show(); } }
private void OpenSubForm <T>(CurrentSubForm subFormType) where T : Form, new() { if (currentSubForm != subFormType) { currentSubForm = subFormType; this.panel1.Controls.Clear(); T SubForm = new T(); SubForm.FormBorderStyle = FormBorderStyle.None; SubForm.TopLevel = false; SubForm.ShowInTaskbar = false; SubForm.Show(); SubForm.Dock = DockStyle.Fill; this.panel1.Controls.Add(SubForm); } }
public static void SygnalizuZamknięcie(ref MainNav main, CurrentSubForm indeks) { main.currentSubForm[(int)indeks] = false; }