我的想法是做一个控件,在里面放上一个编辑筐和一个按钮,但是没有作用,并且运行时候,根本就没有显示,什么原因,如何改进?
unit MyPanel;interfaceuses
SysUtils, Classes, Controls, ExtCtrls,QStdCtrls,QButtons;type
TMyPanel = class(TPanel)
private
Begin_No: TEdit;
B_Ok: TBitBtn;
{ Private declarations }
protected
{ Protected declarations }
public
constructor Create(Owner: TComponent); override;
destructor Destroy; override;
{ Public declarations }
published
{ Published declarations }
end;procedure Register;implementationprocedure Register;
begin
RegisterComponents('xiaoxu', [TMyPanel]);
end;
constructor TMyPanel.Create(Owner: TComponent);
begin
inherited Create(Owner);
Begin_No:=TEdit.Create(self);
B_Ok:=TBitBtn.Create(self);
B_Ok.Kind:=bkOK;
Caption:='';
AutoSize:=true;
end;
destructor TMyPanel.Destroy;
begin
Begin_No.Free;
B_Ok.Free;
inherited;
end;end.
unit MyPanel;interfaceuses
SysUtils, Classes, Controls, ExtCtrls,QStdCtrls,QButtons;type
TMyPanel = class(TPanel)
private
Begin_No: TEdit;
B_Ok: TBitBtn;
{ Private declarations }
protected
{ Protected declarations }
public
constructor Create(Owner: TComponent); override;
destructor Destroy; override;
{ Public declarations }
published
{ Published declarations }
end;procedure Register;implementationprocedure Register;
begin
RegisterComponents('xiaoxu', [TMyPanel]);
end;
constructor TMyPanel.Create(Owner: TComponent);
begin
inherited Create(Owner);
Begin_No:=TEdit.Create(self);
B_Ok:=TBitBtn.Create(self);
B_Ok.Kind:=bkOK;
Caption:='';
AutoSize:=true;
end;
destructor TMyPanel.Destroy;
begin
Begin_No.Free;
B_Ok.Free;
inherited;
end;end.
解决方案 »
- wmf用图片查看器大小是 400 X 500 为什么用image读取时大小变了?
- 怎么把数据库的字段转换成过程名?
- 抗议:codegear首页把中国列为地区,taiwan列为国家(大家看网站首页的location选择项)
- Delphi的USB通信問題
- 查询问题!
- 相对路径问题
- 怎么删除DbGrid或DbGridEh中选中的多行数据
- 怎样才能是应用程序的窗口,永远在最前面,比如我怎样是计算器,在最前面,点击别处也不会有变化呢?
- 有一个窗口已打开,有什么方法可以令它成为活动窗口
- 用了SkinData后edit不能选中
- 杭州DELPHI程序员薪水调研
- 如何在delphi编的软件(没有源程序)中加入或修改某一个按钮的功能?
inherited Create(Owner);
Begin_No:=TEdit.Create(self);
Begin_No.Parent := Self; <<<<<<<<<<--------
B_Ok:=TBitBtn.Create(self);
B_Ok.Parent := Self; <<<<<<<<<<--------
B_Ok.Kind:=bkOK;
Caption:='';
AutoSize:=true;
end;
加上这两句
兄弟,还是不行呀,出现上面提示!
你的Panel是ExtCtrls单元内的,Buttons是QStdCrtls内的,也就是说一个是普通VCL,一个是CLX?互相不兼容的.