private void buttonMinimize_Click(object sender, EventArgs e) { label1.Focus(); WindowState = FormWindowState.Minimized; if (windgetOpen) { windgetOpen = false; settingsWidget.Dispose(); settingsWidget = null; buttonWidget.BackgroundImage = Properties.Resources.buttonWidget; } }
private void button_Widget_Click(object sender, EventArgs e) { label1.Focus(); if (!windgetOpen) { windgetOpen = true; settingsWidget = new FormWidget(); settingsWidget.DesktopLocation = new Point(Left, Top - settingsWidget.Size.Height); settingsWidget.Show(this); button_Widget.BackgroundImage = Properties.Resources.buttonWidgetPressed; } else { windgetOpen = false; settingsWidget.Dispose(); settingsWidget = null; button_Widget.BackgroundImage = Properties.Resources.buttonWidget; } }