为toolStrip控件添加WrapContents=true属性,确保Flow布局能正常换行显示按钮

This commit is contained in:
zqm
2025-11-10 14:13:12 +08:00
parent 08c428a974
commit f88111f8b5

View File

@@ -207,6 +207,8 @@ namespace JoyD.Windows.CS
this.toolStrip.AutoSize = true; this.toolStrip.AutoSize = true;
this.toolStrip.Dock = System.Windows.Forms.DockStyle.None; this.toolStrip.Dock = System.Windows.Forms.DockStyle.None;
this.toolStrip.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.Flow; this.toolStrip.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.Flow;
// 确保Flow布局时控件会换行
this.toolStrip.WrapContents = true;
this.toolStrip.ImageScalingSize = new System.Drawing.Size(20, 20); this.toolStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.btnDrawRegion, this.btnDrawRegion,