谢谢........本人自己做的太丑了,时间急....

解决方案 »

  1.   

    你是想按什么方式来组合
    Image 和 Label 啊
      

  2.   

    再TImage上自己华一行字不就好了……
      

  3.   

    can take the control you made out here for view!
      

  4.   

    把D7的TLabeledEdit代码抄出来,改一下就行了,我用这个方法写了很多,如
    TlabeledCombobox,TlabeledMemo等
      

  5.   

    俺照着别人的改了一个radioimage
    下面带radiobutton的image
    感觉并不是太难
      

  6.   

    FS这个不要脸的,到处卖弄那点破英语keke
      

  7.   

    有一个Tfcsharpbtn控件
    可以上面是图像下面是文字
    你可以上网查查看的
      

  8.   

    那个安装文件是
    1stclass2000ProVcl5.exe   for 5
    1stclass3000ProVcl6.exe   for 6
    1stclass4000ProVcl7.exe   for 7
    找找看
      

  9.   

    unit TxtImage;interfaceuses
      SysUtils, Classes, StdCtrls, Controls, ExtCtrls, Messages, Windows;type
      TTxtImage = class(TImage)
      private
        FImageLabel:TBoundLabel;
        FLabelPosition:TLabelPosition;
        FLabelSpacing:Integer;
        procedure SetLabelPosition(const Value:TLabelPosition);
        procedure SetFLabelSpacing(const Value:Integer);
      protected
        procedure SetParent(AParent:TWinControl);override;
        procedure Notification(AComponent:TComponent;Operation:TOperation);override;
        procedure SetName(const Value:TComponentName);override;
        procedure CMVisiblechanged(var Message:TMessage);
          message CM_VISIBLECHANGED;
        procedure CMEnabledchanged(var Message:TMessage);
          message CM_ENABLEDCHANGED;
        procedure CMBidimodechanged(var Message:TMessage);
          message CM_BIDIMODECHANGED;
      public
        constructor Create(AOwner:TComponent); override; // 构造函数
        procedure SetBounds(ALeft,ATop,AWidth,AHeight:Integer);override;
        procedure SetupInternalLabel;
      published
        property Align;
        property Anchors;
        property AutoSize;
        property Center;
        property Constraints;
        property DragCursor;
        property DragKind;
        property DragMode;
        property Enabled;
        property ImageLabel:TBoundLabel read FImageLabel;
        property IncrementalDisplay;
        property LabelPosition:TLabelPosition read FLabelPosition write SetLabelPosition;
        property LabelSpacing:Integer read FLabelSpacing write SetFLabelSpacing;
        property ParentShowHint;
        property Picture;
        property PopupMenu;
        property Proportional;
        property ShowHint;
        property Stretch;
        property Transparent;
        property Visible;
        property OnClick;
        property OnContextPopup;
        property OnDblClick;
        property OnDragDrop;
        property OnDragOver;
        property OnEndDock;
        property OnEndDrag;
        property OnMouseDown;
        property OnMouseMove;
        property OnMouseUp;
        property OnProgress;
        property OnStartDock;
        property OnStartDrag;
      end;procedure Register;implementationprocedure Register;
    begin
      RegisterComponents('Additional', [TTxtImage]);
    end;{ TTxtImage }procedure TTxtImage.CMBidimodechanged(var Message: TMessage);
    begin
      inherited;
      FImageLabel.BiDiMode:=BiDiMode;
    end;procedure TTxtImage.CMEnabledchanged(var Message: TMessage);
    begin
      inherited;
      FImageLabel.Enabled:=Enabled;
    end;procedure TTxtImage.CMVisiblechanged(var Message: TMessage);
    begin
     inherited;
     FImageLabel.Visible:=Visible;
    end;constructor TTxtImage.Create(AOwner: TComponent);
    begin
      inherited Create(AOwner);// 首先调用父类的构造函数
      FLabelPosition:=lpBelow;
      FLabelSpacing:=3;
      SetupInternalLabel;
    end;procedure TTxtImage.Notification(AComponent: TComponent;
      Operation: TOperation);
    begin
      inherited Notification(AComponent,Operation);
      if (AComponent=FImageLabel) and (Operation=opRemove) then
        FImageLabel:=nil;
    end;procedure TTxtImage.SetBounds(ALeft, ATop, AWidth, AHeight: Integer);
    begin
      inherited SetBounds(ALeft, ATop, AWidth, AHeight);
      SetLabelPosition(FLabelPosition);
    end;procedure TTxtImage.SetFLabelSpacing(const Value: Integer);
    begin
      FLabelSpacing:=Value;
      SetLabelPosition(FLabelPosition);
    end;procedure TTxtImage.SetupInternalLabel;
    begin
      if Assigned(FImageLabel) then exit;
      FImageLabel:=TBoundLabel.Create(Self);
      FImageLabel.FreeNotification(Self);
    //FImageLabel.FocusControl:=Self;
    end;procedure TTxtImage.SetLabelPosition(const Value: TLabelPosition);
    var P:TPoint;
    begin
      if FImageLabel=nil then exit;
      FLabelPosition:=Value;
      case Value of
        lpAbove: P:=Point(Left,Top-FImageLabel.Height-FLabelSpacing);
        lpBelow: P:=Point(Left,Top+Height+FLabelSpacing);
        lpLeft:  P:=Point(Left-FImageLabel.Width-FLabelSpacing,
                      Top+((Height-FImageLabel.Height) div 2));
        lpRight: P:=Point(Left+Width+FlabelSpacing,
                      Top+((Height-FImageLabel.Height) div 2));
      end;
      FImageLabel.SetBounds(P.x,P.y,FImageLabel.Width,FImageLabel.Height);
    end;procedure TTxtImage.SetName(const Value: TComponentName);
    begin
      if (csDesigning in ComponentState) and (FImageLabel.GetTextLen=0) or
        (CompareText(FImageLabel.Caption,Name)=0) then
        FImageLabel.Caption:=Value;
      inherited SetName(Value);
    end;procedure TTxtImage.SetParent(AParent: TWinControl);
    begin
      inherited SetParent(AParent);
      if FImageLabel=nil then exit;
      FImageLabel.Parent:=AParent;
      FImageLabel.Visible:=True;
    end;end.