In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

TComboxBox .... how to make typed characters UPPER CASE

Xailer English public forum
Responder
ChrisGillard
Mensajes: 384
Registrado: Mar May 01, 2007 5:49 pm

TComboxBox .... how to make typed characters UPPER CASE

Mensaje 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
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9252
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

TComboxBox .... how to make typed characters UPPER CASE

Mensaje 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,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
ChrisGillard
Mensajes: 384
Registrado: Mar May 01, 2007 5:49 pm

TComboxBox .... how to make typed characters UPPER CASE

Mensaje 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
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9252
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

TComboxBox .... how to make typed characters UPPER CASE

Mensaje 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,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9252
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

TComboxBox .... how to make typed characters UPPER CASE

Mensaje 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,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
ChrisGillard
Mensajes: 384
Registrado: Mar May 01, 2007 5:49 pm

TComboxBox .... how to make typed characters UPPER CASE

Mensaje 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
Responder