我有一个表格,上面有很多标签。我想设置一个特定的标签页,以在每次加载表单时显示在加载表单时
我用 TabPageControl1.SelectedTab=MyTabPage; 但 selectedtab 的值为 null。它抛出一个引用未设置为对象的异常。
private void PreferencesForm_Load(object sender, EventArgs e)
{
this.cbxCustomDataType.DrawMode = DrawMode.OwnerDrawFixed;
this.cbxCustomDataType.DrawItem += new DrawItemEventHandler(cbxCustomDataType_DrawItem);
this.cbxColumnDataType.DrawMode = DrawMode.OwnerDrawFixed;
this.cbxColumnDataType.DrawItem += new DrawItemEventHandler(cbxColumnDataType_DrawItem);
GetProjectDetails();
this.preferencesTabControl.SelectedTab= tpCompareUpdate;
}