From 309f303c6767ab4fe31d38e6cb310d49ce6c3096 Mon Sep 17 00:00:00 2001 From: Johann Blais Date: Fri, 30 Jan 2026 21:57:34 +0100 Subject: [PATCH] Improve the handling of the layout on resize (#71) --- .../InformationBoxDesigner.Designer.cs | 58 +++++++++---------- InfoBox.Designer/InformationBoxDesigner.resx | 22 ++++++- 2 files changed, 49 insertions(+), 31 deletions(-) diff --git a/InfoBox.Designer/InformationBoxDesigner.Designer.cs b/InfoBox.Designer/InformationBoxDesigner.Designer.cs index 180d03e..503ab01 100644 --- a/InfoBox.Designer/InformationBoxDesigner.Designer.cs +++ b/InfoBox.Designer/InformationBoxDesigner.Designer.cs @@ -31,8 +31,8 @@ private void InitializeComponent() components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InformationBoxDesigner)); groupBox1 = new System.Windows.Forms.GroupBox(); - btnEditText = new System.Windows.Forms.Button(); btnLoremIpsum = new System.Windows.Forms.Button(); + btnEditText = new System.Windows.Forms.Button(); txbText = new System.Windows.Forms.TextBox(); txbTitle = new System.Windows.Forms.TextBox(); label2 = new System.Windows.Forms.Label(); @@ -145,6 +145,7 @@ private void InitializeComponent() rdbSoundMute = new System.Windows.Forms.RadioButton(); rdbSoundDefault = new System.Windows.Forms.RadioButton(); groupBox22 = new System.Windows.Forms.GroupBox(); + lblFontColor = new System.Windows.Forms.Label(); chbCustomFonts = new System.Windows.Forms.CheckBox(); lblMessageFont = new System.Windows.Forms.Label(); txbMessageFont = new System.Windows.Forms.TextBox(); @@ -153,7 +154,6 @@ private void InitializeComponent() txbMessageColor = new System.Windows.Forms.TextBox(); btnMessageColor = new System.Windows.Forms.Button(); dlgFont = new System.Windows.Forms.FontDialog(); - lblFontColor = new System.Windows.Forms.Label(); groupBox1.SuspendLayout(); groupBox2.SuspendLayout(); groupBox3.SuspendLayout(); @@ -179,9 +179,9 @@ private void InitializeComponent() groupBox21.SuspendLayout(); groupBox22.SuspendLayout(); SuspendLayout(); - // + // // groupBox1 - // + // groupBox1.Controls.Add(btnLoremIpsum); groupBox1.Controls.Add(btnEditText); groupBox1.Controls.Add(txbText); @@ -196,9 +196,20 @@ private void InitializeComponent() groupBox1.TabIndex = 0; groupBox1.TabStop = false; groupBox1.Text = "Labels"; - // + // + // btnLoremIpsum + // + btnLoremIpsum.Image = (System.Drawing.Image)resources.GetObject("btnLoremIpsum.Image"); + btnLoremIpsum.Location = new System.Drawing.Point(258, 90); + btnLoremIpsum.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnLoremIpsum.Name = "btnLoremIpsum"; + btnLoremIpsum.Size = new System.Drawing.Size(29, 25); + btnLoremIpsum.TabIndex = 4; + btnLoremIpsum.UseVisualStyleBackColor = true; + btnLoremIpsum.Click += BtnLoremIpsum_Click; + // // btnEditText - // + // btnEditText.Location = new System.Drawing.Point(258, 61); btnEditText.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); btnEditText.Name = "btnEditText"; @@ -207,20 +218,9 @@ private void InitializeComponent() btnEditText.Text = "..."; btnEditText.UseVisualStyleBackColor = true; btnEditText.Click += BtnEditText_Click; - // - // btnLoremIpsum - // - btnLoremIpsum.Location = new System.Drawing.Point(258, 90); - btnLoremIpsum.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - btnLoremIpsum.Name = "btnLoremIpsum"; - btnLoremIpsum.Size = new System.Drawing.Size(29, 25); - btnLoremIpsum.TabIndex = 4; - btnLoremIpsum.Image = new System.Drawing.Bitmap(System.Drawing.SystemIcons.Question.ToBitmap(), new System.Drawing.Size(16, 16)); - btnLoremIpsum.UseVisualStyleBackColor = true; - btnLoremIpsum.Click += BtnLoremIpsum_Click; - // + // // txbText - // + // txbText.Location = new System.Drawing.Point(59, 61); txbText.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); txbText.Multiline = true; @@ -496,7 +496,6 @@ private void InitializeComponent() // // btnShow // - btnShow.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; btnShow.Location = new System.Drawing.Point(377, 662); btnShow.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); btnShow.Name = "btnShow"; @@ -593,7 +592,7 @@ private void InitializeComponent() // // txbCode // - txbCode.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + txbCode.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; txbCode.BackColor = System.Drawing.Color.WhiteSmoke; txbCode.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; txbCode.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0); @@ -608,7 +607,6 @@ private void InitializeComponent() // // btnGenerate // - btnGenerate.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; btnGenerate.ContextMenuStrip = cmsLanguage; btnGenerate.Location = new System.Drawing.Point(138, 662); btnGenerate.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); @@ -1352,7 +1350,6 @@ private void InitializeComponent() // // btnShowModeless // - btnShowModeless.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; btnShowModeless.Location = new System.Drawing.Point(616, 662); btnShowModeless.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); btnShowModeless.Name = "btnShowModeless"; @@ -1476,6 +1473,13 @@ private void InitializeComponent() groupBox22.TabStop = false; groupBox22.Text = "Font"; // + // lblFontColor + // + lblFontColor.Location = new System.Drawing.Point(217, 75); + lblFontColor.Name = "lblFontColor"; + lblFontColor.Size = new System.Drawing.Size(24, 23); + lblFontColor.TabIndex = 7; + // // chbCustomFonts // chbCustomFonts.AutoSize = true; @@ -1547,13 +1551,6 @@ private void InitializeComponent() btnMessageColor.UseVisualStyleBackColor = true; btnMessageColor.Click += BtnMessageColor_Click; // - // lblFontColor - // - lblFontColor.Location = new System.Drawing.Point(217, 75); - lblFontColor.Name = "lblFontColor"; - lblFontColor.Size = new System.Drawing.Size(24, 23); - lblFontColor.TabIndex = 7; - // // InformationBoxDesigner // AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); @@ -1588,6 +1585,7 @@ private void InitializeComponent() Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon"); Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); MaximizeBox = false; + MinimumSize = new System.Drawing.Size(982, 829); Name = "InformationBoxDesigner"; SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; Text = "InformationBox Designer"; diff --git a/InfoBox.Designer/InformationBoxDesigner.resx b/InfoBox.Designer/InformationBoxDesigner.resx index b079295..225e00a 100644 --- a/InfoBox.Designer/InformationBoxDesigner.resx +++ b/InfoBox.Designer/InformationBoxDesigner.resx @@ -117,6 +117,27 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAMdSURBVDhPbZJfTJNnGMV7491moji3JRPikmWIZGGhtF/A + ttABJmODMipGW6WEKO3XBKbxD0u4ES5gW3QbY6PqLCvKJCCKBAvFjX61BQNkZKTVrTXN1l1JoBcju5jA + +C1vs5Ghnuv3nPd5nvNTqZ6jhvr6N2RZ7pRlOSE7HH85ZVmRZdn29Ltn5HA4Xm9va1teXFzErwS5dH2G + po8n8PRPEovGmJiYWG9ubnY97UvJabeXh8NhglNzOD9LUtz4GyUNjyhyPkRXP4+2dpYCW5B4PE57W9vS + JrP4WZjH7y9QeuJ3ShvjSMceUtPyiJOfxymWZ8m1BlBbv2dP5R0mp2ZpbW39ZSNAjH3z9jgljb9S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