![]() |
|
كيف أعرف أي لغة التي أكتب بها في combobox - نسخة قابلة للطباعة +- delphi4arab منتديات دلفي للعرب (https://delphi4arab.net/forum) +-- قسم : منتديات دلفي للعرب التعليمية (https://delphi4arab.net/forum/forumdisplay.php?fid=3) +--- قسم : سؤال و جواب حول دلفي (https://delphi4arab.net/forum/forumdisplay.php?fid=15) +--- الموضوع : كيف أعرف أي لغة التي أكتب بها في combobox (/showthread.php?tid=7613) |
كيف أعرف أي لغة التي أكتب بها في combobox - merzoug2020 - 14-03-2016 السلام عليكم كيف أعرف أي لغة التي أكتب بها و أستطيع أن أغير اللغة من خلال combobox اللغة التي موجودة في ويندوز RE: Delphi و لغة التي أكتب بها - أبو معاذ - 14-03-2016 وعليكم السلام ورحمة الله وبركاته : الدالة الأولى GetKLList تقوم بجلب قائمة اللغات المثبة على جهازك. في الحدث OnCreate للفورم الرئيسي ، نقوم بتعبئة ListBox بقائمة اللغات ، قم أنت بتغيير ListBox إلى ComboBox . و هذا هو الكود. كود : unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
ListBox1: TListBox;
procedure FormCreate(Sender: TObject);
procedure ListBox1Click(Sender: TObject);
private
{ Déclarations privées }
public
{ Déclarations publiques }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure GetKLList(List: TStrings);
var
AList : array [0..9] of Hkl;
AklName: array [0..255] of Char;
i: Longint;
begin
List.Clear;
for i := 0 to GetKeyboardLayoutList(SizeOf(AList), AList) - 1 do
begin
GetLocaleInfo(LoWord(AList[i]), LOCALE_SLANGUAGE, AklName, SizeOf(AklName));
List.AddObject(AklName, Pointer(AList[i]));
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
GetKLList(ListBox1.Items);
end;
procedure TForm1.ListBox1Click(Sender: TObject);
begin
with Sender as TListBox do
ActivateKeyboardLayout(Hkl(Items.Objects[ItemIndex]), 0);
end;
end.RE: Delphi و لغة التي أكتب بها - merzoug2020 - 14-03-2016 بارك الله فيك شغال 100% |