28-11-2014, 04:44 PM
السلام عايكم
هذه طريقة تحويل اتجاه النص حسب تنسيق لوحة المفاتيح
في الحدث KeyPress
هذه طريقة تحويل اتجاه النص حسب تنسيق لوحة المفاتيح
PHP كود :
function winKeyboard: string;
var
WinLanguage: array [0..255] of char;
i:Integer;
begin
i:=GetKeyboardLayout(GetWindowThreadProcessId(GetForegroundWindow ,nil)) And $FFFF;
VerLanguageName(i, WinLanguage, 255);
Result := StrPas(WinLanguage);
end;
في الحدث KeyPress
PHP كود :
procedure TForm10.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if AnsiPos('Arabe',winKeyboard)<>0 then
Edit1.BiDiMode:=bdRightToLeft
else
Edit1.BiDiMode:=bdLeftToRight ;
end;