Or assign an object each to the tag and in the event handler:
with TRadioButton(Sender) do
TSomeObject(Tag).CarryOutAction (Checked)
Dennis.
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Aaron Scott-Boddendijk
> Sent: Tuesday, 15 February 2000 17:54
> To: Multiple recipients of list delphi
> Subject: Re: [DUG]: VB Like Case statement
>
>
> >I know the feeling
> >'Case' in point a RadioGroup with four buttons 'Left',
> 'Right', 'Up', 'Down'
> >What is the 'correct' way to interogate this component in an
> associated event
>
> >ItemIndex is an integer but if you rearrange the radio
> buttons you break the code so
> >is it better to use
>
> 2 possibilities.
>
> 1. use an enumerated type and constant array of strings for display...
> Use a combobox instead of radiobutton
>
> or
>
> 2. give all radiobuttons unique tags and place all
> radiobuttons on a panel... Other
> controls can go there too...
>
> in the TRadioButton.OnClick for all radiobuttons do
> with TRadioButton(Sender) do if Checked then Parent.Tag := Tag
> else Parent.Tag := 0;
>
> in another event you can check the checked radiobutton with
> case Panel1.Tag of
> end;
>
> since you control the tag numbers this use of literals is
> OK although I'd prefer the
> enumeration option...
>
> --
> Aaron@home
>
>
> --------------------------------------------------------------
> -------------
> New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz