父窗體事件 frmPingKongVod frmChild = new frmPingKongVod(); frmChild.Owner = this; frmChild.ShowDialog(); frmChild.Dispose();返給父窗體的txtImagesA賦值TextBox控件放在tabControl1中((TextBox)((System.Windows.Forms.TabControl)frmValue.Controls["tabControl1"]).Controls["txtImagesA"]).Text='' 大家幫我看一下這個有什么錯 先謝了
2 回答

拉丁的傳說
TA貢獻1789條經驗 獲得超8個贊
在做類型轉換的時候,安全起見最好是判斷下轉換后的對象是否為null:
TextBox txt=((TextBox)(System.Windows.Forms.TabControl)frmValue.Controls["tabControl1"]).Controls["txtImagesA"];
if(txt!=null)
{
txt.Text="";
}

神不在的星期二
TA貢獻1963條經驗 獲得超6個贊
frmPingKongVod frmChild = new frmPingKongVod();
frmChild.Owner = this;
frmChild.ShowDialog();
string strResultValue = frmChild.GetValue(); //新增方法,
frmChild.Dispose();
- 2 回答
- 0 關注
- 544 瀏覽
添加回答
舉報
0/150
提交
取消