Verwenden von dynamic casts

void __fastcall TForm1::Label1MouseMove(TObject *Sender, TShiftState Shift, int X, int Y)
{
    TLabel *pLabel;
    TEdit *pEdit;
    TButton *pButton;

    pLabel = dynamic_cast <TLabel *> (Sender);
    pEdit = dynamic_cast <TEdit *> (Sender);
    pButton = dynamic_cast <TButton *> (Sender);

    if (pLabel)
    {
        Label1->Caption = "Ich bin ein TLabel. Mein Name ist "" + pLabel->Name + """;
    }
    else if (pEdit)
         {
            Label1->Caption = "Ich bin ein TEdit. Mein Name ist "" + pEdit->Name + """;
         }
         else if (pButton)
              {
                Label1->Caption = "Ich bin ein TButton. Mein Name ist "" + pButton->Name + """;
              }
}