📄 unit6.pas
字号:
unit Unit6;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls;
type
TFormShutdown = class(TForm)
Image1: TImage;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Label1: TLabel;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure RadioButton1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure RadioButton2KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormShutdown: TFormShutdown;
implementation
{$R *.DFM}
procedure TFormShutdown.Button1Click(Sender: TObject);
begin
if RadioButton1.Checked=true then
ExitWindowsEx(EWX_SHUTDOWN,0)
else
if RadioButton2.Checked=true then
ExitWindowsEx(EWX_REBOOT,0);
end;
procedure TFormShutdown.RadioButton1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key=VK_UP then
begin
RadioButton1.Checked:=true;
RadioButton2.Checked:=false;
end;
if key=VK_DOWN then
begin
RadioButton1.Checked:=false;
RadioButton2.Checked:=true;
end;
end;
procedure TFormShutdown.RadioButton2KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key=VK_UP then
begin
RadioButton1.Checked:=true;
RadioButton2.Checked:=false;
end;
if key=VK_DOWN then
begin
RadioButton1.Checked:=true;
RadioButton2.Checked:=false;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -