我想做一个TImage控件,在它的里面是一个可编辑的TEdit(或TPanel),如下图所视,并且单图形移动时,TEdit或TPanel要一起移动,字体要中间对齐,该怎样做。***********************************************
* *
* *
* *
* *
* *
* *
***********************************************
* TEdit(或TPanel等) *
***********************************************
* *
* *
* *
* *
* *
* *
***********************************************
* TEdit(或TPanel等) *
***********************************************
解决方案 »
- 关于adotable问题
- 關於WinSock網絡編程發送記錄類型(包含了一個位圖流)。
- 如何打开只读文件?
- 有谁知道idwinsock (for delphi)控件在那里下载?谢谢!
- 调查一下各位用的IntraWeb的版本?来者有分.
- 关于网络文件管理系统的几个问题????
- 请问那里有windows 95 的安装程序?我的分不多了,答对者每人十分吧!谢谢了!
- 关于delphi5补丁
- 控件故障,求救!!!
- 致命错误Program or unit 'wen' recursively uses itself 程序或单元递归,错误该怎么办?代码如下
- ActiveX Control 编译问题
- 我们要考试了!谁给我一个聊天室的源程序谢谢!高分100!
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, stdctrls ,Dialogs, extctrls;type
TmyControl = class(TCustomControl)
private
FImage: TImage;
FPicture: TPicture;
FPanel: TPanel;
FEdit: TEdit;
protected
function GetEditText: String;
Procedure SetEditText(const Value: String);
procedure SetPicture(Value: TPicture);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
property Picture: TPicture read FPicture write SetPicture;
property EditText: string read GetEditText write SetEditText;
end;procedure Register;implementationprocedure Register;
begin
RegisterComponents('System', [TmyControl]);
end;{ TmyControl }constructor TmyControl.Create(AOwner: TComponent);
begin
inherited;
//
Width := 200;
Height := 200;
FPanel := TPanel.Create(Self);
FPanel.Parent := Self;
FPanel.Align := alBottom;
FPanel.Visible := True;
FPicture := TPicture.Create; FImage := TImage.Create(Self);
FImage.Parent := Self;
FImage.Align := alClient;
FImage.Visible := True; FEdit := TEdit.Create(Self);
FEdit.Parent := Self;
FEdit.Parent := FPanel;
FEdit.Visible := True;
end;destructor TmyControl.Destroy;
begin
FPicture.Free;
inherited;
end;function TmyControl.GetEditText: String;
begin
//
Result := FEdit.Text;
end;procedure TmyControl.SetEditText(const Value: string);
begin
//
FEdit.Text := Value;
end;procedure TmyControl.SetPicture(Value: TPicture);
begin
FPicture.Assign(Value);
FImage.Picture := FPicture;
end;
end.