I have an issue that I've not yet been able to resolve. I've spent a couple weeks reviewing several forums and help sites and have not yet been able to get exactly what I need. I've had great luck in the past in this forum, and I'm hoping you all can help again.
I need to be able to set the text of a ComboBox when the style of that ComboBox is set to DropDownList. By definition, I understand that the DropDownList only allows the selected text to be one of the possible values in the dropdown box. Really, all I want to do is have the text "(choose)" as the default text of my ComboBox. Currently, the only way I can get this to work is set the style to be DropDown. However, as I'm developing on a Tablet PC, I don't want the PenInputPanel to show when I click in my ComboBox. The only way I can consistently get the PenInputPanel to stay hidden is to set the style to DropDownList.
I've seen several posts from various users suggesting to set the Autoshow property to false, which doesn't exactly work for ComboBoxes. After a bit of work, I was finally able to hide the PenInputPanel for my ComboBox "cbPT" by doing the following code:
My only remaining problem is that if the user clicks in any other control that allows the PenInputPanel to display, it then displays again in my ComboBox, even though it originally was hidden.
I know there must be a way of doing this. I downloaded some new controls created by Infragistics that did exactly what I'm looking for. That package included a ComboBox that has a NullText parameter that could be set. I'm just looking for help to create that same kind of ComboBox on my own. Can anyone help?
I need to be able to set the text of a ComboBox when the style of that ComboBox is set to DropDownList. By definition, I understand that the DropDownList only allows the selected text to be one of the possible values in the dropdown box. Really, all I want to do is have the text "(choose)" as the default text of my ComboBox. Currently, the only way I can get this to work is set the style to be DropDown. However, as I'm developing on a Tablet PC, I don't want the PenInputPanel to show when I click in my ComboBox. The only way I can consistently get the PenInputPanel to stay hidden is to set the style to DropDownList.
I've seen several posts from various users suggesting to set the Autoshow property to false, which doesn't exactly work for ComboBoxes. After a bit of work, I was finally able to hide the PenInputPanel for my ComboBox "cbPT" by doing the following code:
VB.NET:
Dim hwnd As IntPtr = GetWindow(cbPT.Handle, 5)
myPip.AttachedEditWindow = hwnd
myPip.AutoShow = False
My only remaining problem is that if the user clicks in any other control that allows the PenInputPanel to display, it then displays again in my ComboBox, even though it originally was hidden.
I know there must be a way of doing this. I downloaded some new controls created by Infragistics that did exactly what I'm looking for. That package included a ComboBox that has a NullText parameter that could be set. I'm just looking for help to create that same kind of ComboBox on my own. Can anyone help?