Página 1 de 1
TComboxBox .... how to make typed characters UPPER CASE
Publicado: Lun Dic 01, 2014 9:28 pm
por ChrisGillard
When typing into a TComboBox with :nStyle = csDropdown, how do I make the control display the typing in UPPER CASE even if it is typed in lower case.
There is no TMaskComboBox which might be what I want to do.
Maybe the OnChar event to Upper() the nKey being passed or something like that?
Any thoughts would be appreciated.
Regards
Chris
TComboxBox .... how to make typed characters UPPER CASE
Publicado: Mar Dic 02, 2014 11:00 am
por ignacio
Please try this:
METHOD Combobox1Char( oSender, nKey, nFlags ) CLASS TForm1
IF nKey > 96 .AND. nKey < 123
nKey -= 32
PrevWindowProc( oSender:oEditField:Handle, WM_CHAR, nKey, nFlags )
RETURN 0
ENDIF
RETURN Nil
BTW, I encourage you to make your questions on the PRO forums.
Regards,
TComboxBox .... how to make typed characters UPPER CASE
Publicado: Mar Dic 02, 2014 11:17 am
por ChrisGillard
Hi Ignacio,
Thanks for the code sample on how to do this ... I will give it a go.
Yes, should have been in the PRO section ... I was a bit tired last night.
Thanks again.
Chris
TComboxBox .... how to make typed characters UPPER CASE
Publicado: Mar Dic 02, 2014 11:21 am
por ignacio
ChrisGillard escribió el mar, 02 diciembre 2014 11:17Hi Ignacio,
Thanks for the code sample on how to do this ... I will give it a go.
Yes, should have been in the PRO section ... I was a bit tired last night.
Thanks again.
Chris
Please try this first. Is more elegant:
SetWindowLong( ::oCombobox1:oEditField:Handle, GWL_STYLE, nOr( ;
GetWindowLong( ::oCombobox1:oEditField:Handle, GWL_STYLE ), ES_UPPERCASE ) )
Regards,
TComboxBox .... how to make typed characters UPPER CASE
Publicado: Mar Dic 02, 2014 11:30 am
por ignacio
Do not worry. Is just because we give extra high priority and commitment to messages on the PRO section. I knew you were a active subscriber so I decided to answer ASAP as if the message was post on the PRO section, but next time I may be no such attentive.
Regards,
TComboxBox .... how to make typed characters UPPER CASE
Publicado: Jue Dic 04, 2014 11:40 am
por ChrisGillard
Hi Ignacio,
I will try your second piece of code .... it may be more elegant but the first code is more understandable by ordinary humans!
Thanks for your attention on this.
Regards
Chris