[心得] 如何關閉建立此 類別 的視窗
各位好
我使用的是VS 2012
我有一個類別 A 繼承了 Panel 類別
在類別A裡面 我見建立了button 且 有一個click事件 這個事件要怎麼寫
可以關閉 誰建立這類別A 的視窗呢? 謝謝!~
namespace main
{
public partial class FORM1 : Form
{
public FORM1()
{
InitializeComponent();
A a=new A();
this.controls.add(a);
}
}
}
namespace main
{
class A :Panel
{
public A()
{
Button max_btn = new Button();
max_btn.Click += new System.EventHandler(this.closes);
this.Controls.Add(max_btn);
}
private void closes(object sender, EventArgs e)
{
這裡要怎麼寫可以關閉FORM1
}
{
}
}
--
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.185.87.21
→
09/25 11:50, , 1F
09/25 11:50, 1F
→
09/25 11:52, , 2F
09/25 11:52, 2F
→
09/25 11:57, , 3F
09/25 11:57, 3F
→
09/25 12:03, , 4F
09/25 12:03, 4F
C_Sharp 近期熱門文章
PTT數位生活區 即時熱門文章