private void buttonShowUI_Click(object sender, EventArgs e) { //close if already created foreach (Engine.UISystem.Control control in renderTargetUserControl1.ControlManager.Controls) { if (control is WinFormsAppExampleHUD) { control.SetShouldDetach(); return; } } //create WinFormsAppExampleHUD window = new WinFormsAppExampleHUD(); renderTargetUserControl1.ControlManager.Controls.Add(window); }
private void buttonShowUI_Click(object sender, EventArgs e) { //close if already created foreach (Engine.UISystem.Control control in renderTargetUserControl1.ControlManager.Controls) { if (control is WinFormsAppExampleHUD) { control.SetShouldDetach(); return; } } //create WinFormsAppExampleHUD window = new WinFormsAppExampleHUD(); renderTargetUserControl1.ControlManager.Controls.Add(window); }