亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

C#最簡單的關(guān)閉子窗體更新父窗體的實(shí)現(xiàn)方法

 更新時(shí)間:2012年11月29日 20:09:37   作者:  
原理就是將子窗體最為對話框模式彈出,當(dāng)窗體關(guān)閉或取消時(shí)更新主窗體
主窗體Form1關(guān)鍵代碼:

將子窗體最為對話框模式彈出,當(dāng)窗體關(guān)閉或取消時(shí)更新主窗體
復(fù)制代碼 代碼如下:

private void simpleButton1_Click(object sender, EventArgs e)
{
Form2 f2 = new Form2();
f2.Owner = this;
DialogResult result=f2.ShowDialog();
if (result == DialogResult.Cancel)
{
this.gridControl1.DataSource = f2.CreateTable();
}
}

子窗體
復(fù)制代碼 代碼如下:

private void simpleButton1_Click(object sender, EventArgs e)
{
this.Close();
}

public DataTable CreateTable()
{
DataTable tableA1 = new DataTable();
tableA1.Columns.AddRange(new DataColumn[] { new DataColumn("名稱"), new DataColumn("規(guī)格"), new DataColumn("單號"), new DataColumn("數(shù)量") });
tableA1.Rows.Add(new object[] { "螺旋", "LS-X", "111", "2" });
tableA1.Rows.Add(new object[] { "螺旋", "LS-X", "222", "1" });
tableA1.Rows.Add(new object[] { "指針", "LX-3", "523", "2" });
tableA1.Rows.Add(new object[] { "其他", "L-1", "666", "2" });
tableA1.Rows.Add(new object[] { "其他", "L-1", "456", "1" });
tableA1.Rows.Add(new object[] { "其他", "L-1", "990", "2" });
return tableA1;
}

相關(guān)文章

最新評論