From d712b41ecdd3e96b5393582432e8d0a8cdd6eafe Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Thu, 15 Dec 2022 11:30:54 +0000 Subject: [PATCH 1/2] * Demonstrates icon options --- Documents/Help/Changelog.md | 1 + .../Form1.Designer.cs | 104 +++++++++++------- .../KryptonMessageBox Examples/Form1.cs | 13 +++ Source/Krypton Toolkit Examples/Temp.txt | 1 + 4 files changed, 78 insertions(+), 41 deletions(-) create mode 100644 Source/Krypton Toolkit Examples/Temp.txt diff --git a/Documents/Help/Changelog.md b/Documents/Help/Changelog.md index a93a5d8a..ba4470e1 100644 --- a/Documents/Help/Changelog.md +++ b/Documents/Help/Changelog.md @@ -1,6 +1,7 @@ # Standard Toolkit Demos - ChangeLog ## 2022-12-xx - Build 2212 - December 2022 +* Updates `KryptonMessageBoxExample` to showcase [#866](https://github.com/Krypton-Suite/Standard-Toolkit/issues/866) * The help file can now be launched via the `KryptonExplorer` (if installed) * Resolves [#112](https://github.com/Krypton-Suite/Standard-Toolkit-Demos/issues/112), Alpha Branch does not build against "Alpha" of the Toolkit * Fixed theme bug for `KryptonExplorer` diff --git a/Source/Krypton Toolkit Examples/KryptonMessageBox Examples/Form1.Designer.cs b/Source/Krypton Toolkit Examples/KryptonMessageBox Examples/Form1.Designer.cs index efe6bd7b..aa3b35a2 100644 --- a/Source/Krypton Toolkit Examples/KryptonMessageBox Examples/Form1.Designer.cs +++ b/Source/Krypton Toolkit Examples/KryptonMessageBox Examples/Form1.Designer.cs @@ -35,6 +35,7 @@ private void InitializeComponent() this.textBoxMessage = new System.Windows.Forms.TextBox(); this.radioButtonNone = new Krypton.Toolkit.KryptonRadioButton(); this.groupBoxIcon = new Krypton.Toolkit.KryptonGroupBox(); + this.rbShield = new Krypton.Toolkit.KryptonRadioButton(); this.kradWinLogo = new Krypton.Toolkit.KryptonRadioButton(); this.kradQuestion = new Krypton.Toolkit.KryptonRadioButton(); this.kradError = new Krypton.Toolkit.KryptonRadioButton(); @@ -51,12 +52,12 @@ private void InitializeComponent() this.kradOKCancel = new Krypton.Toolkit.KryptonRadioButton(); this.kbtnShow = new Krypton.Toolkit.KryptonButton(); this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); + this.chkShowHelp = new Krypton.Toolkit.KryptonCheckBox(); this.kryptonThemeComboBox1 = new Krypton.Toolkit.KryptonThemeComboBox(); this.kchkRtlReading = new Krypton.Toolkit.KryptonCheckBox(); this.kchkRightAlign = new Krypton.Toolkit.KryptonCheckBox(); this.kryptonLabel1 = new Krypton.Toolkit.KryptonLabel(); - this.rbShield = new Krypton.Toolkit.KryptonRadioButton(); - this.chkShowHelp = new Krypton.Toolkit.KryptonCheckBox(); + this.kcmbIcons = new Krypton.Toolkit.KryptonComboBox(); ((System.ComponentModel.ISupportInitialize)(this.groupBoxIcon)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.groupBoxIcon.Panel)).BeginInit(); this.groupBoxIcon.Panel.SuspendLayout(); @@ -68,13 +69,14 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); this.kryptonPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.kryptonThemeComboBox1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.kcmbIcons)).BeginInit(); this.SuspendLayout(); // // label1 // this.label1.Location = new System.Drawing.Point(4, 21); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(65, 24); + this.label1.Size = new System.Drawing.Size(53, 20); this.label1.TabIndex = 0; this.label1.Target = this.textBoxCaption; this.label1.Values.Text = "&Caption"; @@ -84,7 +86,7 @@ private void InitializeComponent() this.textBoxCaption.CueHint.Padding = new System.Windows.Forms.Padding(0); this.textBoxCaption.Location = new System.Drawing.Point(70, 21); this.textBoxCaption.Name = "textBoxCaption"; - this.textBoxCaption.Size = new System.Drawing.Size(246, 27); + this.textBoxCaption.Size = new System.Drawing.Size(246, 23); this.textBoxCaption.TabIndex = 1; this.textBoxCaption.Text = "Caption"; // @@ -101,7 +103,7 @@ private void InitializeComponent() // this.radioButtonNone.Location = new System.Drawing.Point(14, 3); this.radioButtonNone.Name = "radioButtonNone"; - this.radioButtonNone.Size = new System.Drawing.Size(61, 24); + this.radioButtonNone.Size = new System.Drawing.Size(52, 20); this.radioButtonNone.TabIndex = 0; this.radioButtonNone.Tag = "0"; this.radioButtonNone.Values.Text = "&None"; @@ -114,6 +116,7 @@ private void InitializeComponent() // // groupBoxIcon.Panel // + this.groupBoxIcon.Panel.Controls.Add(this.kcmbIcons); this.groupBoxIcon.Panel.Controls.Add(this.rbShield); this.groupBoxIcon.Panel.Controls.Add(this.kradWinLogo); this.groupBoxIcon.Panel.Controls.Add(this.kradQuestion); @@ -121,15 +124,24 @@ private void InitializeComponent() this.groupBoxIcon.Panel.Controls.Add(this.kradInformation); this.groupBoxIcon.Panel.Controls.Add(this.radioButtonNone); this.groupBoxIcon.Panel.Controls.Add(this.kradWarning); - this.groupBoxIcon.Size = new System.Drawing.Size(246, 136); + this.groupBoxIcon.Size = new System.Drawing.Size(246, 172); this.groupBoxIcon.TabIndex = 5; this.groupBoxIcon.Values.Heading = "Icon"; // + // rbShield + // + this.rbShield.Location = new System.Drawing.Point(111, 29); + this.rbShield.Name = "rbShield"; + this.rbShield.Size = new System.Drawing.Size(56, 20); + this.rbShield.TabIndex = 5; + this.rbShield.Values.Text = "&Shield"; + this.rbShield.CheckedChanged += new System.EventHandler(this.icon_CheckedChanged); + // // kradWinLogo // this.kradWinLogo.Location = new System.Drawing.Point(111, 53); this.kradWinLogo.Name = "kradWinLogo"; - this.kradWinLogo.Size = new System.Drawing.Size(85, 24); + this.kradWinLogo.Size = new System.Drawing.Size(72, 20); this.kradWinLogo.TabIndex = 6; this.kradWinLogo.Values.Text = "Win&Logo"; this.kradWinLogo.CheckedChanged += new System.EventHandler(this.icon_CheckedChanged); @@ -138,7 +150,7 @@ private void InitializeComponent() // this.kradQuestion.Location = new System.Drawing.Point(14, 53); this.kradQuestion.Name = "kradQuestion"; - this.kradQuestion.Size = new System.Drawing.Size(85, 24); + this.kradQuestion.Size = new System.Drawing.Size(72, 20); this.kradQuestion.TabIndex = 2; this.kradQuestion.Values.Text = "&Question"; this.kradQuestion.CheckedChanged += new System.EventHandler(this.icon_CheckedChanged); @@ -147,7 +159,7 @@ private void InitializeComponent() // this.kradError.Location = new System.Drawing.Point(14, 29); this.kradError.Name = "kradError"; - this.kradError.Size = new System.Drawing.Size(56, 24); + this.kradError.Size = new System.Drawing.Size(49, 20); this.kradError.TabIndex = 1; this.kradError.Values.Text = "&Error"; this.kradError.CheckedChanged += new System.EventHandler(this.icon_CheckedChanged); @@ -156,7 +168,7 @@ private void InitializeComponent() // this.kradInformation.Location = new System.Drawing.Point(111, 3); this.kradInformation.Name = "kradInformation"; - this.kradInformation.Size = new System.Drawing.Size(104, 24); + this.kradInformation.Size = new System.Drawing.Size(87, 20); this.kradInformation.TabIndex = 4; this.kradInformation.Values.Text = "&Information"; this.kradInformation.CheckedChanged += new System.EventHandler(this.icon_CheckedChanged); @@ -166,7 +178,7 @@ private void InitializeComponent() this.kradWarning.Checked = true; this.kradWarning.Location = new System.Drawing.Point(14, 79); this.kradWarning.Name = "kradWarning"; - this.kradWarning.Size = new System.Drawing.Size(81, 24); + this.kradWarning.Size = new System.Drawing.Size(69, 20); this.kradWarning.TabIndex = 3; this.kradWarning.Values.Text = "&Warning"; this.kradWarning.CheckedChanged += new System.EventHandler(this.icon_CheckedChanged); @@ -197,7 +209,7 @@ private void InitializeComponent() // this.kradYesNo.Location = new System.Drawing.Point(169, 55); this.kradYesNo.Name = "kradYesNo"; - this.kradYesNo.Size = new System.Drawing.Size(72, 24); + this.kradYesNo.Size = new System.Drawing.Size(61, 20); this.kradYesNo.TabIndex = 6; this.kradYesNo.Values.Text = "Yes No"; this.kradYesNo.CheckedChanged += new System.EventHandler(this.buttons_CheckedChanged); @@ -206,7 +218,7 @@ private void InitializeComponent() // this.kradCancelTryContinue.Location = new System.Drawing.Point(14, 81); this.kradCancelTryContinue.Name = "kradCancelTryContinue"; - this.kradCancelTryContinue.Size = new System.Drawing.Size(160, 24); + this.kradCancelTryContinue.Size = new System.Drawing.Size(132, 20); this.kradCancelTryContinue.TabIndex = 3; this.kradCancelTryContinue.ToolTipValues.Description = "This option will only work if using .NET 6 or greater"; this.kradCancelTryContinue.ToolTipValues.EnableToolTips = true; @@ -217,7 +229,7 @@ private void InitializeComponent() // this.kradRetryCancel.Location = new System.Drawing.Point(14, 55); this.kradRetryCancel.Name = "kradRetryCancel"; - this.kradRetryCancel.Size = new System.Drawing.Size(108, 24); + this.kradRetryCancel.Size = new System.Drawing.Size(90, 20); this.kradRetryCancel.TabIndex = 2; this.kradRetryCancel.Values.Text = "Retry Cancel"; this.kradRetryCancel.CheckedChanged += new System.EventHandler(this.buttons_CheckedChanged); @@ -226,7 +238,7 @@ private void InitializeComponent() // this.kradOK.Location = new System.Drawing.Point(14, 3); this.kradOK.Name = "kradOK"; - this.kradOK.Size = new System.Drawing.Size(44, 24); + this.kradOK.Size = new System.Drawing.Size(39, 20); this.kradOK.TabIndex = 0; this.kradOK.Values.Text = "OK"; this.kradOK.CheckedChanged += new System.EventHandler(this.buttons_CheckedChanged); @@ -235,7 +247,7 @@ private void InitializeComponent() // this.kradYesNoCancel.Location = new System.Drawing.Point(169, 29); this.kradYesNoCancel.Name = "kradYesNoCancel"; - this.kradYesNoCancel.Size = new System.Drawing.Size(121, 24); + this.kradYesNoCancel.Size = new System.Drawing.Size(100, 20); this.kradYesNoCancel.TabIndex = 5; this.kradYesNoCancel.Values.Text = "Yes No Cancel"; this.kradYesNoCancel.CheckedChanged += new System.EventHandler(this.buttons_CheckedChanged); @@ -244,7 +256,7 @@ private void InitializeComponent() // this.kradAbortRetryIgnore.Location = new System.Drawing.Point(169, 3); this.kradAbortRetryIgnore.Name = "kradAbortRetryIgnore"; - this.kradAbortRetryIgnore.Size = new System.Drawing.Size(151, 24); + this.kradAbortRetryIgnore.Size = new System.Drawing.Size(124, 20); this.kradAbortRetryIgnore.TabIndex = 4; this.kradAbortRetryIgnore.Values.Text = "Abort Retry Ignore"; this.kradAbortRetryIgnore.CheckedChanged += new System.EventHandler(this.buttons_CheckedChanged); @@ -254,15 +266,17 @@ private void InitializeComponent() this.kradOKCancel.Checked = true; this.kradOKCancel.Location = new System.Drawing.Point(14, 29); this.kradOKCancel.Name = "kradOKCancel"; - this.kradOKCancel.Size = new System.Drawing.Size(93, 24); + this.kradOKCancel.Size = new System.Drawing.Size(78, 20); this.kradOKCancel.TabIndex = 1; this.kradOKCancel.Values.Text = "OK Cancel"; this.kradOKCancel.CheckedChanged += new System.EventHandler(this.buttons_CheckedChanged); // // kbtnShow // + this.kbtnShow.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.kbtnShow.CornerRoundingRadius = -1F; - this.kbtnShow.Location = new System.Drawing.Point(70, 328); + this.kbtnShow.Location = new System.Drawing.Point(70, 374); this.kbtnShow.Name = "kbtnShow"; this.kbtnShow.Size = new System.Drawing.Size(592, 57); this.kbtnShow.TabIndex = 7; @@ -283,9 +297,17 @@ private void InitializeComponent() this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.kryptonPanel1.Location = new System.Drawing.Point(0, 0); this.kryptonPanel1.Name = "kryptonPanel1"; - this.kryptonPanel1.Size = new System.Drawing.Size(690, 399); + this.kryptonPanel1.Size = new System.Drawing.Size(690, 445); this.kryptonPanel1.TabIndex = 0; // + // chkShowHelp + // + this.chkShowHelp.Location = new System.Drawing.Point(331, 123); + this.chkShowHelp.Name = "chkShowHelp"; + this.chkShowHelp.Size = new System.Drawing.Size(82, 20); + this.chkShowHelp.TabIndex = 8; + this.chkShowHelp.Values.Text = "Show &Help"; + // // kryptonThemeComboBox1 // this.kryptonThemeComboBox1.CornerRoundingRadius = -1F; @@ -295,7 +317,7 @@ private void InitializeComponent() this.kryptonThemeComboBox1.IntegralHeight = false; this.kryptonThemeComboBox1.Location = new System.Drawing.Point(322, 23); this.kryptonThemeComboBox1.Name = "kryptonThemeComboBox1"; - this.kryptonThemeComboBox1.Size = new System.Drawing.Size(340, 25); + this.kryptonThemeComboBox1.Size = new System.Drawing.Size(340, 21); this.kryptonThemeComboBox1.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; this.kryptonThemeComboBox1.TabIndex = 2; // @@ -303,7 +325,7 @@ private void InitializeComponent() // this.kchkRtlReading.Location = new System.Drawing.Point(331, 93); this.kchkRtlReading.Name = "kchkRtlReading"; - this.kchkRtlReading.Size = new System.Drawing.Size(241, 24); + this.kchkRtlReading.Size = new System.Drawing.Size(197, 20); this.kchkRtlReading.TabIndex = 4; this.kchkRtlReading.Values.Text = "MessageBoxOptions.RtlReading"; this.kchkRtlReading.Click += new System.EventHandler(this.ChkRtlReading_CheckedChanged); @@ -312,7 +334,7 @@ private void InitializeComponent() // this.kchkRightAlign.Location = new System.Drawing.Point(331, 67); this.kchkRightAlign.Name = "kchkRightAlign"; - this.kchkRightAlign.Size = new System.Drawing.Size(238, 24); + this.kchkRightAlign.Size = new System.Drawing.Size(195, 20); this.kchkRightAlign.TabIndex = 3; this.kchkRightAlign.Values.Text = "MessageBoxOptions.RightAlign"; // @@ -320,33 +342,30 @@ private void InitializeComponent() // this.kryptonLabel1.Location = new System.Drawing.Point(3, 52); this.kryptonLabel1.Name = "kryptonLabel1"; - this.kryptonLabel1.Size = new System.Drawing.Size(72, 24); + this.kryptonLabel1.Size = new System.Drawing.Size(59, 20); this.kryptonLabel1.TabIndex = 1; this.kryptonLabel1.Target = this.textBoxMessage; this.kryptonLabel1.Values.Text = "&Message"; // - // rbShield - // - this.rbShield.Location = new System.Drawing.Point(111, 29); - this.rbShield.Name = "rbShield"; - this.rbShield.Size = new System.Drawing.Size(65, 24); - this.rbShield.TabIndex = 5; - this.rbShield.Values.Text = "&Shield"; - this.rbShield.CheckedChanged += new System.EventHandler(this.icon_CheckedChanged); - // - // chkShowHelp + // kcmbIcons // - this.chkShowHelp.Location = new System.Drawing.Point(331, 123); - this.chkShowHelp.Name = "chkShowHelp"; - this.chkShowHelp.Size = new System.Drawing.Size(98, 24); - this.chkShowHelp.TabIndex = 8; - this.chkShowHelp.Values.Text = "Show &Help"; + this.kcmbIcons.CornerRoundingRadius = -1F; + this.kcmbIcons.CueHint.Padding = new System.Windows.Forms.Padding(0); + this.kcmbIcons.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.kcmbIcons.DropDownWidth = 215; + this.kcmbIcons.IntegralHeight = false; + this.kcmbIcons.Location = new System.Drawing.Point(14, 114); + this.kcmbIcons.Name = "kcmbIcons"; + this.kcmbIcons.Size = new System.Drawing.Size(215, 21); + this.kcmbIcons.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kcmbIcons.TabIndex = 7; + this.kcmbIcons.SelectedIndexChanged += new System.EventHandler(this.kcmbIcons_SelectedIndexChanged); // // Form1 // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 17F); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(690, 399); + this.ClientSize = new System.Drawing.Size(690, 445); this.Controls.Add(this.textBoxMessage); this.Controls.Add(this.textBoxCaption); this.Controls.Add(this.kryptonPanel1); @@ -356,6 +375,7 @@ private void InitializeComponent() this.MinimizeBox = false; this.Name = "Form1"; this.Text = "KryptonMessageBox Examples"; + this.Load += new System.EventHandler(this.Form1_Load); this.Click += new System.EventHandler(this.ChkRightAlign_CheckedChanged); ((System.ComponentModel.ISupportInitialize)(this.groupBoxIcon.Panel)).EndInit(); this.groupBoxIcon.Panel.ResumeLayout(false); @@ -371,6 +391,7 @@ private void InitializeComponent() this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.kryptonThemeComboBox1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.kcmbIcons)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -405,6 +426,7 @@ private void InitializeComponent() private Krypton.Toolkit.KryptonThemeComboBox kryptonThemeComboBox1; private Krypton.Toolkit.KryptonRadioButton rbShield; private Krypton.Toolkit.KryptonCheckBox chkShowHelp; + private Krypton.Toolkit.KryptonComboBox kcmbIcons; } } diff --git a/Source/Krypton Toolkit Examples/KryptonMessageBox Examples/Form1.cs b/Source/Krypton Toolkit Examples/KryptonMessageBox Examples/Form1.cs index 72d6aefa..bcded245 100644 --- a/Source/Krypton Toolkit Examples/KryptonMessageBox Examples/Form1.cs +++ b/Source/Krypton Toolkit Examples/KryptonMessageBox Examples/Form1.cs @@ -195,5 +195,18 @@ private void Form1_HelpRequested(object sender, HelpEventArgs hlpEvent) // Indicate that the HelpRequested event is handled. hlpEvent.Handled = true; } + + private void Form1_Load(object sender, EventArgs e) + { + foreach (string value in Enum.GetNames(typeof(KryptonMessageBoxIcon))) + { + kcmbIcons.Items.Add(value); + } + } + + private void kcmbIcons_SelectedIndexChanged(object sender, EventArgs e) + { + _kmbIcon = (KryptonMessageBoxIcon)Enum.Parse(typeof(KryptonMessageBoxIcon), kcmbIcons.Text); + } } } diff --git a/Source/Krypton Toolkit Examples/Temp.txt b/Source/Krypton Toolkit Examples/Temp.txt new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/Source/Krypton Toolkit Examples/Temp.txt @@ -0,0 +1 @@ + \ No newline at end of file From 290482eaf9b5f635fa7b0c3061f23e89b067e694 Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Thu, 15 Dec 2022 11:33:34 +0000 Subject: [PATCH 2/2] Delete Temp.txt --- Source/Krypton Toolkit Examples/Temp.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Source/Krypton Toolkit Examples/Temp.txt diff --git a/Source/Krypton Toolkit Examples/Temp.txt b/Source/Krypton Toolkit Examples/Temp.txt deleted file mode 100644 index 5f282702..00000000 --- a/Source/Krypton Toolkit Examples/Temp.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file