Hello everyone,
I have a problem with the TEdit Control, I use this control to enter the user and password.
The user can only enter certain characters, which is evaluated during the KeyPress event.
If the user entered a special character (like a German umlaut) then I don't get the correct ASCII code.
//----------------------------------------------------------
// special character
//-----------------
//ö = #246
//ä = #228
//ü = #252
//Ö = #214
//Ä = #196
//Ü = #220
//ß = #223
//----------------------------------------------------------
procedure TfrmLogIn.txtBenutzernameKeyPress(Sender: TObject; var Key: char);
begin
if Key = #13 then
txtPasswort.SetFocus
else if not (Key in [#8, ' ', '_', #246, #228, #252, #214, #196, #220, #223, 'a'..'z', 'A'..'Z', '0'..'9']) then
begin
Key := #0;
Beep;
end;
end;
If I press 'ü' then I get '?' as Key = 63 '?'
Has anything fundamental changed here? This code worked without any problems about a year ago.
Thank you for your help.