OSDN Git Service

AppliStation-GUI,画面デザイン設定の変更時に動的にOptionPaneへ反映されるように修正
authorttp <ttp@users.sourceforge.jp>
Sat, 10 Apr 2010 17:11:31 +0000 (02:11 +0900)
committerttp <ttp@users.sourceforge.jp>
Sat, 10 Apr 2010 17:11:31 +0000 (02:11 +0900)
AppliStation/AppliStation.Util/OptionDialog.Designer.cs
AppliStation/AppliStation.Util/OptionDialog.cs

index 009291c..1aa6ec5 100644 (file)
                        this.Name = "OptionDialog";\r
                        this.ShowInTaskbar = false;\r
                        this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;\r
+                       this.StyleChanged += new System.EventHandler(this.OptionDialogStyleChanged);\r
+                       this.SystemColorsChanged += new System.EventHandler(this.OptionDialogStyleChanged);\r
                        topTableLayoutPane.ResumeLayout(false);\r
                        topTableLayoutPane.PerformLayout();\r
                        ((System.ComponentModel.ISupportInitialize)(this.iconPictureBox)).EndInit();\r
index 420921a..13ebf38 100644 (file)
@@ -17,17 +17,6 @@ namespace AppliStation.Util
                        // The InitializeComponent() call is required for Windows Forms designer support.\r
                        //\r
                        InitializeComponent();\r
-                       \r
-                       mainInstLabel.Font = SystemFonts.CaptionFont;\r
-                       if (System.Windows.Forms.VisualStyles.VisualStyleInformation.IsEnabledByUser) {\r
-                               mainInstLabel.ForeColor = Color.FromArgb(0x003399);\r
-                               \r
-                               this.BackColor = SystemColors.Window;\r
-                               this.ForeColor = SystemColors.WindowText;\r
-                               separatorLabel.Visible = true;\r
-                       } else {\r
-                               separatorLabel.Visible = false;\r
-                       }\r
                }\r
                \r
                private void SomeButtonClick(object sender, EventArgs e)\r
@@ -159,5 +148,23 @@ namespace AppliStation.Util
                        \r
                        return dialog;\r
                }\r
+               \r
+               void OptionDialogStyleChanged(object sender, EventArgs e)\r
+               {\r
+                       mainInstLabel.Font = SystemFonts.CaptionFont;\r
+                       if (System.Windows.Forms.VisualStyles.VisualStyleInformation.IsEnabledByUser) {\r
+                               mainInstLabel.ForeColor = Color.FromArgb(0x003399);\r
+                               \r
+                               this.BackColor = SystemColors.Window;\r
+                               this.ForeColor = SystemColors.WindowText;\r
+                               separatorLabel.Visible = true;\r
+                       } else {\r
+                               mainInstLabel.ForeColor = Color.Empty;\r
+                               \r
+                               this.BackColor = Color.Empty;\r
+                               this.ForeColor = Color.Empty;\r
+                               separatorLabel.Visible = false;\r
+                       }\r
+               }\r
        }\r
 }\r