Einzelnen Beitrag anzeigen

Klaus01

Registriert seit: 30. Nov 2005
Ort: München
5.755 Beiträge
 
Delphi 10.4 Sydney
 
#16

Re: OOP - Neuling braucht ein bisschen Hilfe

  Alt 23. Mai 2010, 20:19
Guten Abend,

Zitat von DelphiHilfe:
Lists the radio buttons in the radio group.

Class
TCustomRadioGroup

Syntax


property Items: TStrings read FItems write SetItems;


Description
Items holds a TStrings object that lists the captions of the radio buttons in the group. In TCustomRadioGroup descendants, where this property is published, radio buttons can be added or removed by editing the Items list from the Object Inspector.
Was Du vermutlich suchst ist das:
Zitat von DelphiHilfe:
Indicates which radio button in the group is currently selected.

Class
TCustomRadioGroup

Syntax


property ItemIndex: Integer read FItemIndex write SetItemIndex;


Description
ItemIndex holds the index of the selected radio button in the Items list. (The first button is 0.) The value of ItemIndex changes at runtime as the user selects radio buttons. If you want one of the buttons to appear selected when the application starts, assign that button to ItemIndex at design time; otherwise, leave ItemIndex set to the default value of -1, which means that no button is selected.
[edit] bzw. eine Kombination aus beiden.
Delphi-Quellcode:
begin
  case Radiogroup1.itemindex of
   0:
    begin
     Bezeichnung := 'Verbrennungsmotor';
     Auto:=TFahrzeug.create(Radiogroup1.Items[RadioGroup1.ItemIndex], Ed_L_H.Text); // oder auch
     // Auto:=TFahrzeug.create(Bezeichnung, Ed_L_H.Text); // oder auch
     //Auto:=TFahrzeug.create(Radiogroup1.Items[0], Ed_L_H.Text);

     Memo1.lines.Add := Auto.getDaten;
    end;
.. und gewöhn Dich mal an die Regel "eine Frage pro Thread"

Grüße
Klaus
Klaus
  Mit Zitat antworten Zitat