Board index » delphi » Any Capitalize-capable components

Any Capitalize-capable components

Do any of the Delphi edit-components allow input to be capitalized as it's
entered?
 

Re:Any Capitalize-capable components


Quote
<DC-...@My.House.com> wrote in message

news:eva4hsssqp0ra2proaagshjviepqgaoq22@4ax.com...

Quote
> Do any of the Delphi edit-components allow input to be capitalized as it's
> entered?

tEdit.CharCase

Re:Any Capitalize-capable components


Thanks for the reply, but I guess I must have mis-phrased my question.
TEdit has lower, normal, and upper options. It's my understanding that
"lower" forces all text to lower-case, "normal" leaves text as it was
entered, and "upper" forces all text to upper-case. I'm looking for an
option/property that capitalizes the first letter of each word
automatically.

On Fri, 5 May 2000 00:22:00 -0400, "Bruce Roberts"

Quote
<no.junk.please....@attcanada.net> wrote:

><DC-...@My.House.com> wrote in message
>news:eva4hsssqp0ra2proaagshjviepqgaoq22@4ax.com...
>> Do any of the Delphi edit-components allow input to be capitalized as it's
>> entered?

>tEdit.CharCase

Re:Any Capitalize-capable components


Quote
DC-...@My.House.com wrote:

> I'm looking for an
> option/property that capitalizes the first letter of each word
> automatically.

This code, at least with TDbEdit, in OnKeyPress event does the trick:

procedure TForm1.CompanyKeyPress(Sender: TObject; var Key: Char);
{Upcase the first character of every word}
begin
  begin                      
   if((Sender as Tdbedit).SelStart=0)
   then
   Key:=UpCase(Key);
   with Sender as TDBEdit do
   if Text[SelStart]=' '
   then
   Key:=UpCase(Key);
 end;
end;

Markku Nevalainen

Re:Any Capitalize-capable components


Orpheus from www.turbopower.com has controls that will do
as you describe.

Good luck.
Gene

Quote
DC-...@My.House.com wrote in message ...
>Do any of the Delphi edit-components allow input to be capitalized as it's
>entered?

Re:Any Capitalize-capable components


Thanks for the code! I had an idea how to code it as an event, but not the
knowledge of the language.
Quote
On Fri, 05 May 2000 14:38:30 +0200, Markku Nevalainen <m...@iki.fi> wrote:
>DC-...@My.House.com wrote:

>> I'm looking for an
>> option/property that capitalizes the first letter of each word
>> automatically.

>This code, at least with TDbEdit, in OnKeyPress event does the trick:

>procedure TForm1.CompanyKeyPress(Sender: TObject; var Key: Char);
>{Upcase the first character of every word}
>begin
>  begin                      
>   if((Sender as Tdbedit).SelStart=0)
>   then
>   Key:=UpCase(Key);
>   with Sender as TDBEdit do
>   if Text[SelStart]=' '
>   then
>   Key:=UpCase(Key);
> end;
>end;

>Markku Nevalainen

Re:Any Capitalize-capable components


Thanks.
Quote
On Fri, 5 May 2000 18:56:40 -0400, "Gene" <ge...@mindspring.com> wrote:
>Orpheus from www.turbopower.com has controls that will do
>as you describe.

>Good luck.
>Gene

>DC-...@My.House.com wrote in message ...
>>Do any of the Delphi edit-components allow input to be capitalized as it's
>>entered?

Other Threads