Sida 1 av 2
Skapa ett formulär med ett bestämt utseende 1
Skapa ett nytt projekt med ett formulär som ser exakt lika ut som detta.
Spara projektet i mappen T2\projekt 1.
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls;
type
{ TForm1 }
TForm1 = class(TForm) Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
ListBox1: TListBox;
RadioGroup1: TRadioGroup;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
private
{ private declarations }
TRadioGroup TListBox
Sida 2 av 2
public
{ public declarations } end;
var
Form1: TForm1;
implementation { TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
RadioGroup1.ItemIndex := 0;
ListBox1.Items.Add(Button1.Caption);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
RadioGroup1.ItemIndex := 1;
ListBox1.Items.Add(Button2.Caption);
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
RadioGroup1.ItemIndex := 2;
ListBox1.Items.Add(Button3.Caption);
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
RadioGroup1.ItemIndex := 3;
ListBox1.Items.Add(Button4.Caption);
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
RadioGroup1.ItemIndex := 4;
ListBox1.Items.Add(Button5.Caption);
end;
procedure TForm1.Button6Click(Sender: TObject);
begin
RadioGroup1.ItemIndex := 5;
ListBox1.Items.Add(Button6.Caption);
end;
initialization {$I unit1.lrs}
end.