unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;
type
TForm1 =
class(TForm)
RadioGroup1: TRadioGroup;
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
procedure MyMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure MyKeyUp(Sender: TObject;
var Key: Word;
Shift: TShiftState);
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
var z: Integer;
begin
for z := 0
to Pred(RadioGroup1.ControlCount)
do
with TRadioButton(RadioGroup1.Controls[z])
do
begin
OnMouseUp := MyMouseUp;
OnKeyUp := MyKeyUp;
end;
end;
procedure TForm1.MyKeyUp(Sender: TObject;
var Key: Word;
Shift: TShiftState);
begin
showmessage('
Mit einer Taste: '+IntToStr(RadioGroup1.ItemIndex));
end;
procedure TForm1.MyMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
showmessage('
Mit der Maus: '+IntToStr(RadioGroup1.ItemIndex));
end;
end.