求Image + Label 的组合控件...... 谢谢........本人自己做的太丑了,时间急.... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你是想按什么方式来组合Image 和 Label 啊 再TImage上自己华一行字不就好了…… can take the control you made out here for view! 把D7的TLabeledEdit代码抄出来,改一下就行了,我用这个方法写了很多,如TlabeledCombobox,TlabeledMemo等 俺照着别人的改了一个radioimage下面带radiobutton的image感觉并不是太难 FS这个不要脸的,到处卖弄那点破英语keke 有一个Tfcsharpbtn控件可以上面是图像下面是文字你可以上网查查看的 那个安装文件是1stclass2000ProVcl5.exe for 51stclass3000ProVcl6.exe for 61stclass4000ProVcl7.exe for 7找找看 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. 期待RAD的移动开发版本了 图片存储的时候怎么控制大小? 怎样才能把小孩培养成才?(+提前结帖) 高分求视频编码协议文档 FASTREPORT 3.0使用问题?? delphi技术问题。各路高手帮帮小弟啊! 急! 请问在注册表中更改哪个键值能隐藏文件名的后缀? 小第最近做毕业设计,遇到下面一些问题,分散的只剩下这一点,全给大家了,还望大家不吝指导!感谢了! 关于OleObject.Document的怪问题 求判断一个点是否在一条直线上的算法 ehlib安装以后,为什么一加载grid就报错呢! SOCKET问题
Image 和 Label 啊
TlabeledCombobox,TlabeledMemo等
下面带radiobutton的image
感觉并不是太难
可以上面是图像下面是文字
你可以上网查查看的
1stclass2000ProVcl5.exe for 5
1stclass3000ProVcl6.exe for 6
1stclass4000ProVcl7.exe for 7
找找看
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.