How to use “Sender” parameter with “As” operator for more then one class at a time?
问题 In Delphi, sometimes we need to do this... function TForm1.EDIT_Click(Sender: TObject); begin (Sender As TEdit).Text := ''; end; ...but sometimes we need to repeat the function with other object class like... function TForm1.COMBOBOX_Click(Sender: TObject); begin (Sender As TComboBox).Text := ''; end; ...because the operator As does not accept flexibility. It must know the class in order to allow the .Text that come after the () . Sometimes the code gets full of similar functions and