From: ttp Date: Sat, 10 Apr 2010 17:11:31 +0000 (+0900) Subject: AppliStation-GUI,画面デザイン設定の変更時に動的にOptionPaneへ反映されるように修正 X-Git-Tag: v1.3.4~3 X-Git-Url: http://git.sourceforge.jp/view?p=applistation%2FAppliStation.git;a=commitdiff_plain;h=b107ade2da4a65e496a0ecbdb102bc33266a1c73 AppliStation-GUI,画面デザイン設定の変更時に動的にOptionPaneへ反映されるように修正 --- diff --git a/AppliStation/AppliStation.Util/OptionDialog.Designer.cs b/AppliStation/AppliStation.Util/OptionDialog.Designer.cs index 009291c..1aa6ec5 100644 --- a/AppliStation/AppliStation.Util/OptionDialog.Designer.cs +++ b/AppliStation/AppliStation.Util/OptionDialog.Designer.cs @@ -205,6 +205,8 @@ this.Name = "OptionDialog"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.StyleChanged += new System.EventHandler(this.OptionDialogStyleChanged); + this.SystemColorsChanged += new System.EventHandler(this.OptionDialogStyleChanged); topTableLayoutPane.ResumeLayout(false); topTableLayoutPane.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.iconPictureBox)).EndInit(); diff --git a/AppliStation/AppliStation.Util/OptionDialog.cs b/AppliStation/AppliStation.Util/OptionDialog.cs index 420921a..13ebf38 100644 --- a/AppliStation/AppliStation.Util/OptionDialog.cs +++ b/AppliStation/AppliStation.Util/OptionDialog.cs @@ -17,17 +17,6 @@ namespace AppliStation.Util // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); - - mainInstLabel.Font = SystemFonts.CaptionFont; - if (System.Windows.Forms.VisualStyles.VisualStyleInformation.IsEnabledByUser) { - mainInstLabel.ForeColor = Color.FromArgb(0x003399); - - this.BackColor = SystemColors.Window; - this.ForeColor = SystemColors.WindowText; - separatorLabel.Visible = true; - } else { - separatorLabel.Visible = false; - } } private void SomeButtonClick(object sender, EventArgs e) @@ -159,5 +148,23 @@ namespace AppliStation.Util return dialog; } + + void OptionDialogStyleChanged(object sender, EventArgs e) + { + mainInstLabel.Font = SystemFonts.CaptionFont; + if (System.Windows.Forms.VisualStyles.VisualStyleInformation.IsEnabledByUser) { + mainInstLabel.ForeColor = Color.FromArgb(0x003399); + + this.BackColor = SystemColors.Window; + this.ForeColor = SystemColors.WindowText; + separatorLabel.Visible = true; + } else { + mainInstLabel.ForeColor = Color.Empty; + + this.BackColor = Color.Empty; + this.ForeColor = Color.Empty; + separatorLabel.Visible = false; + } + } } }