unit1.pas

来自「很多 delphi 精彩小例子。供大家参考。」· PAS 代码 · 共 60 行

PAS
60
字号
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtDlgs, ExtCtrls;

type
  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    RadioButton3: TRadioButton;
    Panel1: TPanel;
    OpenPictureDialog1: TOpenPictureDialog;
    Image1: TImage;
    procedure RadioButton1Click(Sender: TObject);
    procedure RadioButton2Click(Sender: TObject);
    procedure RadioButton3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.RadioButton1Click(Sender: TObject);
begin
if RadioButton1.Checked then
Begin
image1.picture.LoadFromFile('1.bmp');
end;
end;

procedure TForm1.RadioButton2Click(Sender: TObject);
begin
if RadioButton2.Checked then
Begin
image1.picture.LoadFromFile('2.bmp');
end;
end;


procedure TForm1.RadioButton3Click(Sender: TObject);
begin
if RadioButton3.Checked then
Begin
image1.picture.LoadFromFile('3.bmp')
end;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?