(Moderator)
Registriert seit: 6. Mai 2005
Ort: Berlin
4.956 Beiträge
Delphi 2007 Enterprise
|
Re: Den selben Komponenten (fast) gleiche Prozeduren zuweise
20. Okt 2008, 21:36
Delphi-Quellcode:
Procedure TForm1.FormCreate (Sender : TComponent);
Procedure _SetupComboBox (aCombobox : TComboBox; aTag : Integer);
Begin
aComboBox.Tag := aTag;
aComboBox.OnChange := AnyComboBoxChange;
End;
Begin
SetupComboBox (ComboBox1, 1);
SetupComboBox (ComboBox2, 2);
SetupComboBox (ComboBox3, 3);
SetupComboBox (ComboBox4, 4);
SetupComboBox (ComboBox5, 5);
SetupComboBox (ComboBox6, 6);
SetupComboBox (ComboBox7, 7);
SetupComboBox (ComboBox8, 8);
End;
procedure TForm1.AnyComboBoxChange(Sender: TObject);
var
box: TCombobox;
begin
box := Sender as TComboBox;
faecher_loeschen(box.Text, box.Tag);
end;
"Wenn ist das Nunstruck git und Slotermeyer? Ja! Beiherhund das Oder die Flipperwaldt gersput!"
(Monty Python "Joke Warefare")
|
|
Zitat
|