Форма 2: раскрывающийся список меню tolstrip, созданный при инициализации компонента в форме 2. Я пытался скрыть эту панель инструментов из функции загрузки формы 1., но она не работает.
this.mHelp.DropDownItems.AddRange(new ToolStripItem[2]
{
(ToolStripItem) this.contentsToolStripMenuItem,
(ToolStripItem) this.apProposToolStripMenuItem
});
this.mHelp.Name = "mHelp";
this.mHelp.Size = new Size(44, 20);
this.mHelp.Text = "Help";
this.contentsToolStripMenuItem.Name = "contentsToolStripMenuItem";
this.contentsToolStripMenuItem.Size = new Size(122, 22);
this.contentsToolStripMenuItem.Text = "Contents";
this.contentsToolStripMenuItem.Click += new EventHandler(this.contentsToolStripMenuItem_Click);
this.apProposToolStripMenuItem.Image = (Image) componentResourceManager.GetObject("apProposToolStripMenuItem.Image");
this.apProposToolStripMenuItem.Name = "apProposToolStripMenuItem";
this.apProposToolStripMenuItem.Size = new Size(122, 22);
this.apProposToolStripMenuItem.Text = "About";
this.apProposToolStripMenuItem.Click += new EventHandler(this.apProposToolStripMenuItem_Click);
this.Load += new EventHandler(this.DocumentSpace_Load);
Форма 1:
private void Home_Load(object sender, EventArgs e)
{
if (about.Text == "About")
{
((Button)about.Controls["button1"]).Text = "test_Button";
((Label)about.Controls["label3"]).Text = "test";
}
this.Show();
this.Activate();
this.SetFormName();
}
Помоги мне разобраться с этим.