我一直在努力的TabControl在C#。我在哪裏添加了全部10個選項卡中的文本框,標籤,datagridviews,面板。當我試圖在文本框中使用自動完成時,它給了我一個異常,指出「錯誤創建窗口句柄Win32異常」。以下是我的代碼:錯誤使用C#創建窗口句柄
private void textBoxCustomerMNO_Enter(object sender, EventArgs e)
{
textBoxCustomerMNO.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
textBoxCustomerMNO.AutoCompleteSource = AutoCompleteSource.CustomSource;
AutoCompleteStringCollection CustomerMobileNo = new AutoCompleteStringCollection();
string Query = "select PATIENT_MNO from MEDICINES_SALE_RECEPIT";
DataTable CustomerNos = clsConnection.GetDataTable(Query);
if (CustomerNos.Rows.Count > 0)
{
foreach(DataRow row in CustomerNos.Rows)
{
CustomerMobileNo.Add(row["PATIENT_MNO"].ToString().Trim());
}
}
}
1.連接類已創建。
哪條線拋出異常? –
textBoxCustomerMNO.AutoCompleteMode = AutoCompleteMode.SuggestAppend; – user3032171
該代碼執行或第一次拋出異常..? –