diff --git a/Source/Krypton Components/TestForm/StartScreen.Designer.cs b/Source/Krypton Components/TestForm/StartScreen.Designer.cs index 19c6ea4baa..5107191fba 100644 --- a/Source/Krypton Components/TestForm/StartScreen.Designer.cs +++ b/Source/Krypton Components/TestForm/StartScreen.Designer.cs @@ -53,10 +53,12 @@ private void InitializeComponent() // // kbtnExit // - this.kbtnExit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.kbtnExit.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.kbtnExit.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.kbtnExit.Location = new System.Drawing.Point(12, 490); + this.kbtnExit.Location = new System.Drawing.Point(12, 691); this.kbtnExit.Margin = new System.Windows.Forms.Padding(2); + this.kbtnExit.MinimumSize = new System.Drawing.Size(0, 30); this.kbtnExit.Name = "kbtnExit"; this.kbtnExit.Size = new System.Drawing.Size(526, 30); this.kbtnExit.TabIndex = 15; @@ -72,8 +74,9 @@ private void InitializeComponent() // // tlpMain // - this.tlpMain.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); + this.tlpMain.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.tlpMain.ColumnCount = 1; this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tlpMain.Location = new System.Drawing.Point(12, 51); @@ -81,14 +84,16 @@ private void InitializeComponent() this.tlpMain.RowCount = 2; this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tlpMain.Size = new System.Drawing.Size(526, 428); + this.tlpMain.Size = new System.Drawing.Size(526, 629); this.tlpMain.TabIndex = 2; // // tbFilter // + this.tbFilter.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.tbFilter.ButtonSpecs.Add(this.btnClearFilter); this.tbFilter.Location = new System.Drawing.Point(12, 12); - this.tbFilter.MinimumSize = new System.Drawing.Size(526, 30); + this.tbFilter.MinimumSize = new System.Drawing.Size(0, 30); this.tbFilter.Name = "tbFilter"; this.tbFilter.Size = new System.Drawing.Size(526, 30); this.tbFilter.StateCommon.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; @@ -102,11 +107,11 @@ private void InitializeComponent() // kryptonThemeListBox1 // this.kryptonThemeListBox1.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.kryptonThemeListBox1.DefaultPalette = Krypton.Toolkit.PaletteMode.Microsoft365Blue; - this.kryptonThemeListBox1.Location = new System.Drawing.Point(559, 12); + this.kryptonThemeListBox1.Location = new System.Drawing.Point(551, 12); this.kryptonThemeListBox1.Name = "kryptonThemeListBox1"; - this.kryptonThemeListBox1.Size = new System.Drawing.Size(313, 520); + this.kryptonThemeListBox1.Size = new System.Drawing.Size(313, 709); this.kryptonThemeListBox1.TabIndex = 17; // // btnDockTopRight @@ -124,12 +129,12 @@ private void InitializeComponent() // // StartScreen // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.ButtonSpecs.Add(this.btnRestoreSize); this.ButtonSpecs.Add(this.btnDockTopRight); this.CancelButton = this.kbtnExit; - this.ClientSize = new System.Drawing.Size(900, 540); + this.ClientSize = new System.Drawing.Size(876, 729); this.Controls.Add(this.kryptonThemeListBox1); this.Controls.Add(this.tbFilter); this.Controls.Add(this.tlpMain); diff --git a/Source/Krypton Components/TestForm/StartScreen.cs b/Source/Krypton Components/TestForm/StartScreen.cs index 7352a25742..f339bdd1e9 100644 --- a/Source/Krypton Components/TestForm/StartScreen.cs +++ b/Source/Krypton Components/TestForm/StartScreen.cs @@ -7,6 +7,9 @@ */ #endregion +using System.Reflection; +using System.Windows.Forms; + namespace TestForm; public partial class StartScreen : KryptonForm @@ -38,6 +41,7 @@ public StartScreen() btnRestoreSize.Click += OnBtnRestoreSizeClick; SetupFilterBox(); + SetupExitButton(); SetupTableLayoutPanel(); AddButtons(); SortButtons(); @@ -58,7 +62,6 @@ private void AddButtons() CreateButton("FormBorder Test", string.Empty, typeof(FormBorderTest)); CreateButton("Header Examples", string.Empty, typeof(HeaderExamples)); CreateButton("Menu/Tool/Status Strips", string.Empty, typeof(MenuToolBarStatusStripTest)); - //CreateButton("Powered By Button", string.Empty, typeof(PoweredByButtonForm)); CreateButton("ProgressBar", "Checkout if progress has been made.", typeof(ProgressBarTest)); CreateButton("Ribbon / Navigator / Workspace", string.Empty, typeof(RibbonNavigatorWorkspaceTest)); CreateButton("Splash Screen", string.Empty, typeof(SplashScreenExample)); @@ -146,6 +149,12 @@ private void CreateButton(string heading, string description, Type formType, Ima _buttons.Add(button); } + private void SetupExitButton() + { + FontFamily family = KryptonManager.CurrentGlobalPalette.GetContentShortTextFont(PaletteContentStyle.InputControlStandalone, PaletteState.Normal)!.FontFamily; + kbtnExit.StateCommon.Content.ShortText.Font = new Font(family, 14F, FontStyle.Regular); + } + private void SetupFilterBox() { tbFilter.Clear(); @@ -192,12 +201,11 @@ private void SortButtons() private void SetupTableLayoutPanel() { + SetTableLayoutPanelDoubleBuffered(true); tlpMain.RowCount = 0; tlpMain.ColumnCount = 1; tlpMain.AutoSize = false; - tlpMain.MaximumSize = new Size(_panelWidth, 0); - tlpMain.MinimumSize = new Size(_panelWidth, 464); tlpMain.BackColor = Color.Transparent; tlpMain.Padding = new Padding(0); tlpMain.Margin = new Padding(0); @@ -207,6 +215,19 @@ private void SetupTableLayoutPanel() tlpMain.ColumnStyles.Clear(); tlpMain.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); } + + private void SetTableLayoutPanelDoubleBuffered(bool enableDoubleBuffering) + { + PropertyInfo? propertyInfo = typeof(TableLayoutPanel).GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic); + if (propertyInfo is not null) + { + propertyInfo.SetValue(tlpMain, enableDoubleBuffering); + } + else + { + throw new NullReferenceException(nameof(propertyInfo)); + } + } private void AddButtonsToTlpMain() {