Richard,
In order to do this, you will have to subclass the ComboBox, or handle
the appropriate events to cause the change in behavior that you want. I
think the easier way is to create a custom ComboBox where you override the
OnKeyDown and OnKeyUp (and maybe the OnKeyPress) methods and alter the
KeyEventArgs instance passed in to represent an upper-case character being
typed. I'm not positive it will work. If it doesn't, then you will
probably have to override the WndProc method and handle the appropriate
windows messages that handle key events, and modify them so that they
represent an upper case character.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Richard MSL" <Ri*************@nospam.nospam> wrote in message
news:9B**********************************@microsof t.com...
How do you make a ComboBox force casing to uppercase? With a TextBox, I do
this:
TextBox txtName;
this.txtName.CharacterCasing = CharacterCasing.Upper;
And it makes whatever the user types appear in upper case, which is what I
want. But with a ComboBox, if I do this:
ComboBox TCombo;
this.TCombo.CharacterCasing = CharacterCasing.Upper;
It fails, because CharacterCasing is not a member of the ComboBox class.
How
should this be done? Thanks.