public void ShowTabInfo(Control form) { pnlMinerInfo.Controls.Clear(); pnlMinerInfo.Controls.Add(form); form.Dock = DockStyle.Fill; IMinerInfoTab tab = form as IMinerInfoTab; if (tab != null) { tab.UpdateUI(); } CurrentTab = tab;//its ok if its null after cast form.Show(); }
public void ShowTabInfo(Form form) { form.TopLevel = false; pnlMinerInfo.Controls.Clear(); pnlMinerInfo.Controls.Add(form); form.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; form.Dock = DockStyle.Fill; IMinerInfoTab tab = form as IMinerInfoTab; if (tab != null) { tab.UpdateUI(); } CurrentTab = tab;//its ok if its null after cast form.Show(); }