110,534
社区成员
发帖
与我相关
我的任务
分享
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Content)]
public ToolStripButton barAdd = new ToolStripButton();
这样试试
private void InitializeComponent()
{
this.SuspendLayout();
//
// Component1
//
this.InitBar();
this.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.VerticalStackWithOverflow;
this.ResumeLayout(false);
}
public void InitBar()
{
if (barAdd == null) barAdd = new ToolStripButton();
barAdd.Text = "hehe";
this.Items.Add(barAdd);
}