1、调整大小和位置
button_addcontroller.Width = 144;
btn_set_enviroment.Width = 59;
btn_set_enviroment.Height = 27;
btn_set_enviroment.Location = new System.Drawing.Point(363, 6);
button_addcontroller.Location = new System.Drawing.Point(430,6);
2、在enable时,使能一些控件。但在disable时,使能page中的某些控件。
使用中发现,一旦disable的一些控件,再enable就不是特别简单。
private void Page_ANX_Enable()
{
foreach (Control ctl in Test_Group.Controls)
{
Page_ANX_Read.Enabled = true;
Page_Tools.Enabled = true;
Page_Read_Data.Enabled = true;
Page_Write_Data.Enabled = true;
Page_Loop_Test.Enabled = true;
}
foreach (Control item in Page_Read_Data.Controls)
{
item.Enabled = true;
}
}
private void Page_ANX_Disable()
{
foreach (Control ctl in Test_Group.Controls)
{
if (ctl.Controls.Contains(Page_ANX_Read))
{
Page_ANX_Read.Enabled = true;
//Page_Write_Data.Enabled = true;
Page_Tools.Enabled = true;
//Page_Read_Data.Enabled =true;
Page_Write_Data.Enabled = false;
Page_Loop_Test.Enabled = false;
foreach (Control ct in Page_Read_Data.Controls)
{
if (ct == gBoxDisplayEnableDe||ct==gBox_displayEnable||ct == gBox_EDIDSN)
{
ct.Enabled = true;
}
else if(ct == gBox_Psensor)
{
foreach (Control item in gBox_Psensor.Controls)
{
if (item== btn_psensorReg)
{
item.Enabled = true;
}
else
{
item.Enabled = false;
}
}
}
else
{
ct.Enabled = false;
}
}
}
else
{
//ctl.Enabled = false;
}
}
}
..