private void SettingsMenu_Click(object sender, EventArgs e) { SettingsPane settingsPane = new SettingsPane(); settingsPane.ShowDialog(); // Delay 0.1s to allow settings to sync. System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer(); timer.Interval = 100; timer.Tick += (obj, eventArgs) => { timer.Stop(); UpdateTrayMenu(); UpdateUIFromSettings(); }; timer.Start(); }