Var
t_image : TIMAGE;
begin
t_image:=timage.Create(self);
t_image.Canvas.TextOut(10,10,'dsfasd');
t_image.Picture.LoadFromFile('e:\qw.bmp');
t_image.Height:=100;
t_image.Width:=100;
t_image.top:=self.Height div 2;
t_image.left:=self.Width div 2;
t_image.Visible:=true;
t_Image.Parent := Form1 ;
t_image.BringToFront;
t_image.parent:=panel1;
t_image.show;
更这个差不多阿
t_image : TIMAGE;
begin
t_image:=timage.Create(self);
t_image.Canvas.TextOut(10,10,'dsfasd');
t_image.Picture.LoadFromFile('e:\qw.bmp');
t_image.Height:=100;
t_image.Width:=100;
t_image.top:=self.Height div 2;
t_image.left:=self.Width div 2;
t_image.Visible:=true;
t_Image.Parent := Form1 ;
t_image.BringToFront;
t_image.parent:=panel1;
t_image.show;
更这个差不多阿
解决方案 »
- 多线程使用过程中出现内存泄露,大家来帮我查查在哪个地方。分不多,谢谢帮忙啦。
- delphi问题
- 请问一下这个函数在哪个DLL中有啊?
- [关于窗体设计]无标题窗体--始终在最上面、可移动、只可以改变宽度
- 如何利用DBLOOKUPCOMBOBOX控件中显示的内容作为查询条件?(新手)
- 请各位帮忙,我是新手,关于类的建立和引用。
- 怎样取得局域网内所有机器的名称和IP地址呢?
- 各位高手,有谁知道在Windows2000下如何进行端口操作!!!~~~欢迎探讨~~~
- ZL,CX两个储存过之前的z切换.
- 如何清空打印队列
- 在注册表中写入有关信息时,找不到“Idapi.cfg”文件,只有“Idapi32.cfg”能代替吗?为什么安装完成后还是会报错:database engine (er
- 如何在DELPHI程序中作数据库的pack操作?
//==============================================================================
//动态创建控件******************************************************************
//==============================================================================
function DynaCreateComponent(Owner: TComponent; CompType: TControlClass; CompName: String; Left,Top,Width,Height:Integer): TControl;
begin
if (Owner.FindComponent(CompName)<>nil) and not(Owner.FindComponent(CompName) is TControl) then
begin
Result := nil;
exit;
end;
Result := Owner.FindComponent(CompName) as TControl;
if Result=nil then
begin
Result := CompType.Create(Owner);
with Result do
begin
if Owner is TwinControl then
begin
SetBounds(Left,Top,Width,Height);
Parent := TwinControl(Owner);{如果是可视构件,则显示之}
if Owner is TForm then TForm(Owner).ActiveControl := TWinControl(Result);{设置窗口焦点}
end;
end;
Result.Name := CompName;
end
else {Result<>Nil}
if not(Result is CompType) then
begin
Result := nil;
Exit;
end;
Result.Visible := True;
end;
{ 对于未知数量的控件组,利用TList
var ControlList: Tlist; CreateNum: integer;
const CreateClass : TControlClass = TButton;//可以任意修改TControlClass = TEdit或TPanel等。效果一样。
var i:integer; APoint: Pointer;
ControlList := TList.Create;
ControlList.Clear;
CreateNum := 10;
for i:=1 to CreateNum do
begin
APoint := Pointer(DynaCreateComponent(self,CreateClass,'Button_' + IntToStr(i),0,i*20+1,60,20));//创建
ControlList.Add(APoint);
end;
TButton(ControlList.Items[i]).Caption := 'XXXX';}