1 (edited by v_pozidis 2020-01-07 09:52:23)

Topic: Greek language in a specific text field SOS

Hi to all,
how can I use in a specific text field only letters from the Greek alphabet (it dose't matters the region, it could be also Greman,,,,) . What I want to do is that in case I have two or more languages in my PC it should accept only the Greek letters in the specific text field.
I have tried the code

if (Key in ['Α'..'ω']) then
  begin

   //else if not included in the greek alphabet
    Key := #0;
  end;

but it gives me  error, your help please

Thank you in advance.

Re: Greek language in a specific text field SOS

procedure frmAdmin_ePass_OnEnter (Sender: TObject);
begin
  frmAdmin.ePass.Tag := GetKeyboardLayout;
  ChangeKeyboardLayout(LANG_ENGLISH);
end;
procedure frmAdmin_ePass_OnExit (Sender: TObject);
begin
  if frmAdmin.ePass.Tag <> 0 then ChangeKeyboardLayout(frmAdmin.ePass.Tag);
end;

Re: Greek language in a specific text field SOS

Thank you but what I asked was specific text field  and not in all the program. Any idea how to do that?

Re: Greek language in a specific text field SOS

v_pozidis wrote:

Thank you but what I asked was specific text field  and not in all the program. Any idea how to do that?

keyboard layout changes ..

procedure Form1_Edit2_OnEnter (Sender: TObject);
begin
  Form1.Edit2.Tag := GetKeyboardLayout;
  ChangeKeyboardLayout(LANG_ENGLISH);
end;

 
when you move the cursor from the layout field

procedure Form1_Edit2_OnExit (Sender: TObject);
begin
  if Form1.Edit2.Tag <> 0 then ChangeKeyboardLayout(Form1.Edit2.Tag);
end;

 
 

LANG_INVARIANT
LANG_AFRIKAANS
LANG_ALBANIAN
LANG_ARABIC
LANG_BASQUE
LANG_BELARUSIAN
LANG_BULGARIAN
LANG_CATALAN
LANG_CHINESE
LANG_CROATIAN
LANG_CZECH
LANG_DANISH
LANG_DUTCH
LANG_ENGLISH
LANG_ESTONIAN
LANG_FAEROESE
LANG_FARSI
LANG_FINNISH
LANG_FRENCH
LANG_GERMAN
LANG_GREEK
LANG_HEBREW
LANG_HUNGARIAN
LANG_ICELANDIC
LANG_INDONESIAN
LANG_ITALIAN
LANG_JAPANESE
LANG_KOREAN
LANG_LATVIAN
LANG_LITHUANIAN
LANG_NORWEGIAN
LANG_POLISH
LANG_PORTUGUESE
LANG_ROMANIAN
LANG_RUSSIAN
LANG_SERBIAN
LANG_SLOVAK
LANG_SLOVENIAN
LANG_SPANISH
LANG_SWEDISH
LANG_THAI
LANG_TURKISH
LANG_UKRAINIAN
LANG_VIETNAMESE
Post's attachments

Attachment icon test.7z 2.56 kb, 238 downloads since 2020-01-07 

Re: Greek language in a specific text field SOS

Thank you