I have been working on tabcontrol in C#. Where i have added textboxes, labels,datagridviews, panels in all 10 tabs. When i am trying to use autocomplete in textbox it gives me an exception stating "Error Creating Window Handle-Win32 Exception". Below is my code:
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. connection class is already created.