找到了一个,那位BCB高手将此代码转成Delphi的:
//---------------------------------------------------------------------------
#ifndef CenteredH
#define CenteredH
//---------------------------------------------------------------------------
#include <vcl/SysUtils.hpp>
#include <vcl/Controls.hpp>
#include <vcl/Classes.hpp>
#include <vcl/Forms.hpp>
#include <vcl/StdCtrls.hpp>
//---------------------------------------------------------------------------
class TCenteredLabel : public TLabel
{
private:
void __fastcall SetDocked(bool ADocked);
void __fastcall SetAuthor(AnsiString anAuthor);
String FAuthor;
bool FDocked;
int HCenter;
int VCenter;
protected:
virtual void __fastcall TCenteredLabel::Loaded(void);
virtual void __fastcall TCenteredLabel:
aint(void);
virtual void __fastcall TCenteredLabel::SetParent(TWinControl *AParent);
public:
__fastcall TCenteredLabel(TComponent* Owner);
__published:
__property AnsiString Author={read=FAuthor, write=SetAuthor};
__property bool Docked = {read=FDocked, write=SetDocked, default=true};
};
//---------------------------------------------------------------------------
#endif