>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

Reply via email to