在tabcontrol1上有四个tabpage页,即tabPage1,tabPage2,tabPage3,tabPage4,我想点击tabPage3时,弹出一个窗体,进行相关的设置!开始不会,在网上搜点资料,就知道如何用了,和大家分享一下的!
private void tabControl1_SelectedIndexChanged(object sender,
EventArgs e)
{
if (tabControl1.SelectedTab ==
tabPage3)
{
SocialAnalysisSetup sas = new
SocialAnalysisSetup();//生成一个窗体对象
sas.Show();//显示窗体
string sql3 = “select 参数 from 参数表 where 值=1”;
conn.Open();
OleDbCommand cmd3 = new OleDbCommand(sql3, conn);
OleDbDataReader dr3 = cmd3.ExecuteReader();
while(dr3.Read())
{
AnalysisName = dr3[“参数”].ToString();
}
conn.Close();
}
}