diff --git a/Documents/Help/Changelog.md b/Documents/Help/Changelog.md index 7b7c789c0..be7e88b29 100644 --- a/Documents/Help/Changelog.md +++ b/Documents/Help/Changelog.md @@ -7,6 +7,7 @@ ## 2022-11-xx - Build 2211 - November 2022 * Implemented [#728](https://github.com/Krypton-Suite/Standard-Toolkit/issues/728), Bring MessageBox `States` inline with latest .Net 6 * Made enumeration `SchemeOfficeColors` public, so they can be used to make external themes +* Resolved [#688](https://github.com/Krypton-Suite/Standard-Toolkit/issues/688), KryptonComboBox / KryptonNumericUpDown / KryptonDomainUpDown Anchor Sizing no as expected when anchored Top & Bottom * Resolved [#722](https://github.com/Krypton-Suite/Standard-Toolkit/issues/722), KryptonRichTextBox disabled colour cannot be set * Resolved [#662](https://github.com/Krypton-Suite/Standard-Toolkit/issues/662), Can not "Control / Set Disabled" Background Colour Of Comboboxes, in DropDown mode * Resolved [#737](https://github.com/Krypton-Suite/Standard-Toolkit/issues/737), `Office 2013 - Dark Grey` for `PaletteMode` in designer causes a crash diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonComboBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonComboBox.cs index 071666744..88cc2573b 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonComboBox.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonComboBox.cs @@ -2085,6 +2085,20 @@ public override Size GetPreferredSize(Size proposedSize) return base.GetPreferredSize(proposedSize); } + /// https://github.com/Krypton-Suite/Standard-Toolkit/issues/688 + /// A bitwise combination of the values. The default is and . + [Category(@"CatLayout")] + [DefaultValue(AnchorStyles.Top | AnchorStyles.Left)] + [Description(@"Defines the edges of the container to which a certain control is bound. When a control is anchored to an edge, the distance between the control's closest edge and the specified edge will remain constant")] + [RefreshProperties(RefreshProperties.Repaint)] + public override AnchorStyles Anchor + { + get => base.Anchor; + set => base.Anchor = value.HasFlag(AnchorStyles.Bottom | AnchorStyles.Top) + ? value ^ AnchorStyles.Bottom + : value; + } + /// /// Gets the rectangle that represents the display area of the control. /// diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDomainUpDown.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDomainUpDown.cs index 670fae815..275c94962 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDomainUpDown.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonDomainUpDown.cs @@ -1403,6 +1403,20 @@ public override Size GetPreferredSize(Size proposedSize) } } + /// https://github.com/Krypton-Suite/Standard-Toolkit/issues/688 + /// A bitwise combination of the values. The default is and . + [Category(@"CatLayout")] + [DefaultValue(AnchorStyles.Top | AnchorStyles.Left)] + [Description(@"Defines the edges of the container to which a certain control is bound. When a control is anchored to an edge, the distance between the control's closest edge and the specified edge will remain constant")] + [RefreshProperties(RefreshProperties.Repaint)] + public override AnchorStyles Anchor + { + get => base.Anchor; + set => base.Anchor = value.HasFlag(AnchorStyles.Bottom | AnchorStyles.Top) + ? value ^ AnchorStyles.Bottom + : value; + } + /// /// Gets the rectangle that represents the display area of the control. /// diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonNumericUpDown.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonNumericUpDown.cs index 75deafeb9..f215fc9b6 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonNumericUpDown.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonNumericUpDown.cs @@ -1479,6 +1479,20 @@ public override Size GetPreferredSize(Size proposedSize) } } + /// https://github.com/Krypton-Suite/Standard-Toolkit/issues/688 + /// A bitwise combination of the values. The default is and . + [Category(@"CatLayout")] + [DefaultValue(AnchorStyles.Top | AnchorStyles.Left)] + [Description(@"Defines the edges of the container to which a certain control is bound. When a control is anchored to an edge, the distance between the control's closest edge and the specified edge will remain constant")] + [RefreshProperties(RefreshProperties.Repaint)] + public override AnchorStyles Anchor + { + get => base.Anchor; + set => base.Anchor = value.HasFlag(AnchorStyles.Bottom | AnchorStyles.Top) + ? value ^ AnchorStyles.Bottom + : value; + } + /// /// Gets the rectangle that represents the display area of the control. /// @@ -1784,12 +1798,13 @@ protected override void SetBoundsCore(int x, int y, // Override the actual height used height = preferredSize.Height; } - if (specified.HasFlag(BoundsSpecified.Width)) - { - // Override the actual height used - width = preferredSize.Width; - } - + // Do not do the following otherwise the designer will not allow width to be set! + // https://github.com/Krypton-Suite/Standard-Toolkit/issues/724 + //if (specified.HasFlag(BoundsSpecified.Width)) + //{ + // // Override the actual Width used + // width = preferredSize.Width; + //} base.SetBoundsCore(x, y, width, height, specified); } diff --git a/Source/Krypton Components/TestForm/Form1.Designer.cs b/Source/Krypton Components/TestForm/Form1.Designer.cs index f7a079590..a1c1bda0d 100644 --- a/Source/Krypton Components/TestForm/Form1.Designer.cs +++ b/Source/Krypton Components/TestForm/Form1.Designer.cs @@ -29,27 +29,27 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); + this.kryptonDomainUpDown1 = new Krypton.Toolkit.KryptonDomainUpDown(); + this.kryptonTextBox1 = new Krypton.Toolkit.KryptonTextBox(); + this.kryptonNumericUpDown1 = new Krypton.Toolkit.KryptonNumericUpDown(); this.label1 = new System.Windows.Forms.Label(); this.comboBox1 = new System.Windows.Forms.ComboBox(); - this.kryptonComboBox3 = new Krypton.Toolkit.KryptonComboBox(); this.kryptonComboBox2 = new Krypton.Toolkit.KryptonComboBox(); this.kryptonButton1 = new Krypton.Toolkit.KryptonButton(); - this.kryptonComboBox1 = new Krypton.Toolkit.KryptonComboBox(); ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonComboBox3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.kryptonComboBox2)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonComboBox1)).BeginInit(); this.SuspendLayout(); // // kryptonPanel1 // + this.kryptonPanel1.Controls.Add(this.kryptonDomainUpDown1); + this.kryptonPanel1.Controls.Add(this.kryptonTextBox1); + this.kryptonPanel1.Controls.Add(this.kryptonNumericUpDown1); this.kryptonPanel1.Controls.Add(this.label1); this.kryptonPanel1.Controls.Add(this.comboBox1); - this.kryptonPanel1.Controls.Add(this.kryptonComboBox3); this.kryptonPanel1.Controls.Add(this.kryptonComboBox2); this.kryptonPanel1.Controls.Add(this.kryptonButton1); - this.kryptonPanel1.Controls.Add(this.kryptonComboBox1); this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.kryptonPanel1.Location = new System.Drawing.Point(0, 0); this.kryptonPanel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); @@ -57,11 +57,44 @@ private void InitializeComponent() this.kryptonPanel1.Size = new System.Drawing.Size(800, 450); this.kryptonPanel1.TabIndex = 0; // + // kryptonDomainUpDown1 + // + this.kryptonDomainUpDown1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.kryptonDomainUpDown1.CornerRoundingRadius = -1F; + this.kryptonDomainUpDown1.Location = new System.Drawing.Point(480, 379); + this.kryptonDomainUpDown1.Name = "kryptonDomainUpDown1"; + this.kryptonDomainUpDown1.Size = new System.Drawing.Size(210, 26); + this.kryptonDomainUpDown1.TabIndex = 8; + this.kryptonDomainUpDown1.Text = "kryptonDomainUpDown1"; + // + // kryptonTextBox1 + // + this.kryptonTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.kryptonTextBox1.Location = new System.Drawing.Point(480, 329); + this.kryptonTextBox1.Name = "kryptonTextBox1"; + this.kryptonTextBox1.Size = new System.Drawing.Size(210, 27); + this.kryptonTextBox1.TabIndex = 7; + this.kryptonTextBox1.Text = "kryptonTextBox1"; + // + // kryptonNumericUpDown1 + // + this.kryptonNumericUpDown1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.kryptonNumericUpDown1.Location = new System.Drawing.Point(480, 284); + this.kryptonNumericUpDown1.Name = "kryptonNumericUpDown1"; + this.kryptonNumericUpDown1.Size = new System.Drawing.Size(210, 26); + this.kryptonNumericUpDown1.TabIndex = 6; + // // label1 // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(361, 37); + this.label1.Location = new System.Drawing.Point(483, 203); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(161, 20); this.label1.TabIndex = 5; @@ -69,31 +102,27 @@ private void InitializeComponent() // // comboBox1 // + this.comboBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.comboBox1.Font = new System.Drawing.Font("Segoe Script", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.comboBox1.FormattingEnabled = true; - this.comboBox1.Location = new System.Drawing.Point(358, 66); + this.comboBox1.Location = new System.Drawing.Point(480, 232); + this.comboBox1.MinimumSize = new System.Drawing.Size(150, 0); this.comboBox1.Name = "comboBox1"; this.comboBox1.Size = new System.Drawing.Size(215, 31); this.comboBox1.TabIndex = 4; this.comboBox1.Text = "33333333333333"; // - // kryptonComboBox3 - // - this.kryptonComboBox3.CornerRoundingRadius = -1F; - this.kryptonComboBox3.DropDownWidth = 215; - this.kryptonComboBox3.IntegralHeight = false; - this.kryptonComboBox3.Location = new System.Drawing.Point(76, 66); - this.kryptonComboBox3.Name = "kryptonComboBox3"; - this.kryptonComboBox3.Size = new System.Drawing.Size(215, 25); - this.kryptonComboBox3.TabIndex = 3; - this.kryptonComboBox3.Text = "33333333333333333"; - // // kryptonComboBox2 // + this.kryptonComboBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.kryptonComboBox2.CornerRoundingRadius = -1F; this.kryptonComboBox2.DropDownWidth = 215; this.kryptonComboBox2.IntegralHeight = false; - this.kryptonComboBox2.Location = new System.Drawing.Point(76, 27); + this.kryptonComboBox2.Location = new System.Drawing.Point(480, 149); + this.kryptonComboBox2.MinimumSize = new System.Drawing.Size(150, 0); this.kryptonComboBox2.Name = "kryptonComboBox2"; this.kryptonComboBox2.Size = new System.Drawing.Size(215, 29); this.kryptonComboBox2.StateCommon.ComboBox.Content.Font = new System.Drawing.Font("Segoe Script", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); @@ -109,18 +138,6 @@ private void InitializeComponent() this.kryptonButton1.TabIndex = 1; this.kryptonButton1.Values.Text = "kryptonButton1"; // - // kryptonComboBox1 - // - this.kryptonComboBox1.CornerRoundingRadius = -1F; - this.kryptonComboBox1.DropDownWidth = 215; - this.kryptonComboBox1.IntegralHeight = false; - this.kryptonComboBox1.Location = new System.Drawing.Point(76, 104); - this.kryptonComboBox1.Name = "kryptonComboBox1"; - this.kryptonComboBox1.Size = new System.Drawing.Size(215, 25); - this.kryptonComboBox1.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Center; - this.kryptonComboBox1.TabIndex = 0; - this.kryptonComboBox1.Text = "Center"; - // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); @@ -134,9 +151,7 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonComboBox3)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.kryptonComboBox2)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonComboBox1)).EndInit(); this.ResumeLayout(false); } @@ -144,11 +159,12 @@ private void InitializeComponent() #endregion private Krypton.Toolkit.KryptonPanel kryptonPanel1; - private Krypton.Toolkit.KryptonComboBox kryptonComboBox1; private Krypton.Toolkit.KryptonButton kryptonButton1; - private Krypton.Toolkit.KryptonComboBox kryptonComboBox3; private Krypton.Toolkit.KryptonComboBox kryptonComboBox2; private System.Windows.Forms.ComboBox comboBox1; private System.Windows.Forms.Label label1; + private Krypton.Toolkit.KryptonNumericUpDown kryptonNumericUpDown1; + private Krypton.Toolkit.KryptonDomainUpDown kryptonDomainUpDown1; + private Krypton.Toolkit.KryptonTextBox kryptonTextBox1; } } \ No newline at end of file