unit1.pas
来自「稿件名称:用Delphi实现多语言界面,运行环境:win2000 delphi6」· PAS 代码 · 共 63 行
PAS
63 行
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Menus, StdCtrls, MultiLan;
type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
File1: TMenuItem;
Exit1: TMenuItem;
Language1: TMenuItem;
English1: TMenuItem;
Chinese1: TMenuItem;
Label1: TLabel;
procedure Exit1Click(Sender: TObject);
procedure English1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Chinese1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
const
ENGLISH = (SUBLANG_ENGLISH_US shl 10) or LANG_ENGLISH;
CHINESE = (SUBLANG_CHINESE_SIMPLIFIED shl 10) or LANG_CHINESE;
procedure TForm1.Exit1Click(Sender: TObject);
begin
Close;
end;
procedure TForm1.English1Click(Sender: TObject);
begin
if LoadNewResourceModule(ENGLISH) <> 0 then
ReinitializeForms;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
if LoadNewResourceModule(SysLocale.DefaultLCID) <> 0 then
ReinitializeForms;
end;
procedure TForm1.Chinese1Click(Sender: TObject);
begin
if LoadNewResourceModule(CHINESE) <> 0 then
ReinitializeForms;
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?