private void InitializeComponent() { flowLayoutPanel = new FlowLayoutPanel(); label1 = new Label(); tabCloseButton = new MyTabCloseButton(); // label1 this.label1.Margin = new Padding(0); this.label1.MinimumSize = new Size(60, 12); this.label1.Text = "载入中"; // tabCloseButton this.tabCloseButton.Margin = new Padding(10, 2, 0, 2); this.tabCloseButton.Size = new Size(12, 12); this.tabCloseButton.Click += MyTabCloseButton_Click; // flowLayoutPanel this.flowLayoutPanel.Dock = DockStyle.Fill; this.flowLayoutPanel.FlowDirection = FlowDirection.LeftToRight; this.flowLayoutPanel.WrapContents = false; this.flowLayoutPanel.Margin = new Padding(10); this.flowLayoutPanel.Controls.Add(label1); this.flowLayoutPanel.Controls.Add(tabCloseButton); //MyTabNavItem this.SuspendLayout(); this.Font = new Font("微软雅黑", 12, GraphicsUnit.Pixel); this.BorderStyle = BorderStyle.None; this.Controls.Add(flowLayoutPanel); this.ResumeLayout(false); this.Click += MyTabNavItem_Click; }
/// <summary> /// 设计器支持所需的方法 - 不要修改 /// 使用代码编辑器修改此方法的内容。 /// </summary> private void InitializeComponent() { //components = new System.ComponentModel.Container(); flowLayoutPanel = new FlowLayoutPanel(); label1 = new Label(); tabCloseButton = new MyTabCloseButton(); // label1 this.label1.Margin = new Padding(0); this.label1.MinimumSize = new Size(60, 12); // tabCloseButton this.tabCloseButton.Margin = new Padding(10, 2, 0, 2); this.Size = new Size(8, 8); // flowLayoutPanel this.flowLayoutPanel.Margin = new Padding(10); this.Controls.Add(label1); this.Controls.Add(tabCloseButton); //MyTabNavItem this.SuspendLayout(); this.Font = new Font("微软雅黑", 12, GraphicsUnit.Pixel); this.Controls.Add(flowLayoutPanel); this.ResumeLayout(); }