private void WindowAddedHandler(object sender, GlobalWindowManagerEventArgs e) { if (e.Form is SettingsForm settingsForm) { settingsForm.Shown += delegate { try { var imageIndex = settingsForm.SettingsTabControl.ImageList.Images.Add(Properties.Resources.icon, Color.Transparent); var newTab = new TabPage("Unreal Engine") { UseVisualStyleBackColor = true, ImageIndex = imageIndex }; var optionsPanel = new SettingsPanel(this); newTab.Controls.Add(optionsPanel); optionsPanel.Dock = DockStyle.Fill; settingsForm.SettingsTabControl.TabPages.Add(newTab); } catch (Exception ex) { Debug.Fail(ex.ToString()); } }; } }
private void OnWindowAdded(object sender, GlobalWindowManagerEventArgs e) { if (e.Form is SettingsForm settingsForm) { settingsForm.Shown += delegate(object sender2, EventArgs e2) { try { var settingsTabControl = settingsForm.Controls.Find("settingsTabControl", true).FirstOrDefault() as TabControl; if (settingsTabControl != null) { var newTab = new TabPage("# pygamehack") { UseVisualStyleBackColor = true }; setupSettingsTab(newTab); settingsTabControl.TabPages.Add(newTab); } } catch { } }; } }
/// <summary> /// This method gets called when a new windows is opened. /// You can use this function to add a settings panel into the settings dialog for example. /// </summary> private void OnWindowAdded(object sender, GlobalWindowManagerEventArgs e) { if (e.Form is SettingsForm settingsForm) { settingsForm.Shown += delegate(object sender2, EventArgs e2) { try { var settingsTabControl = settingsForm.Controls.Find("settingsTabControl", true).FirstOrDefault() as TabControl; if (settingsTabControl != null) { var newTab = new TabPage("SamplePlugin") { UseVisualStyleBackColor = true }; // You can use a custom control here so you have designer support //var myControl = new MyControl(); //myControl.Dock = DockStyle.Fill; //newTab.Controls.Add(myControl); // or add the controls manually. var checkBox = new CheckBox { Text = "Use Sample Setting" }; newTab.Controls.Add(checkBox); settingsTabControl.TabPages.Add(newTab); } } catch { } }; } }