Komponentenentwicklung TFont property



  • hi!

    hab folgendes problem: Ich brauche für meine Komponente mehrere Font Einstellungen, da ich zwei TLabel in der Komponente habe und diese unterschiedliche Font Einstellungen haben... daher meine Frage:
    Wie deklariere und definiere ich alles richtig ohne beim ändern der Font-Einstellungen im ObjectInspecter ne Exception zu kriegen...

    Hilfe = thx



  • Im Header:

    //Kompo- Klasse
    .
    .
    private:
      TFont *FFont;
      void __fastcall SetFont(TFont *Font);
    .
    .
    __published:
      __property TFont *Font ={read=FFont, write=SetFont};
    .
    .
    

    In CPP- Datei:

    void __fastcall TKomponentenName::SetFont(TFont *Font)
    {
      FFont->Assign(Font);
    }
    

Anmelden zum Antworten