Hello all,
I am having a problem with my combobox. I am setting its datasource to a class that I have created. Everytime that I try and reset the combobox with the following code
the combobox does some wierd stuff. Most of the time the text portion will not clear, but sometimes the entire box clears and there is not even the drop arrow visible. The combobox also will not work like it should after the code. What I mean by that is that it fills in with the new information, but it will not fill in the text portion or have a moving highlight anymore.
So what I have thought about doing is dynamically creating a combobox and then destreoying it and making a new one when it is time to refill it. The problem is that I have a sub routine that is tied to the combobox, so I need to know if it is possible to tie the sub routine to the dcreated combobox.
This is going to be my first attempt at dynamically creating a control so any additional help or tips that I can get will be greatly appreciated as well.
Any help, as always, is greatly appreciated.
Brian
I am having a problem with my combobox. I am setting its datasource to a class that I have created. Everytime that I try and reset the combobox with the following code
Code:
cmbPDFItems.Text = ""
cmbPDFItems.DataSource = Nothing
If cmbPDFItems.Items.Count > 0 Then
cmbPDFItems.Items.Clear()
End If
the combobox does some wierd stuff. Most of the time the text portion will not clear, but sometimes the entire box clears and there is not even the drop arrow visible. The combobox also will not work like it should after the code. What I mean by that is that it fills in with the new information, but it will not fill in the text portion or have a moving highlight anymore.
So what I have thought about doing is dynamically creating a combobox and then destreoying it and making a new one when it is time to refill it. The problem is that I have a sub routine that is tied to the combobox, so I need to know if it is possible to tie the sub routine to the dcreated combobox.
This is going to be my first attempt at dynamically creating a control so any additional help or tips that I can get will be greatly appreciated as well.
Any help, as always, is greatly appreciated.
Brian