*****请问:如果我想在listbox的item.insert时,insert一个Tedit,即制作一个可编辑的listbox.应该如何实现?*****急!急!急!急!*** 好象listbox 不能做其它控件的容器你可以另外设一个edit在编辑时将内容写入改完后存回listbox 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以的,我试过了。我只是想把他做成小控件,以后用着方便。以下是全部代码大家可以借鉴一下:高手快来帮忙啊!!!!!!unit Unit1;interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) ListBox1: TListBox; Edit1: TEdit; procedure ListBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.DFM}procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);beginif index=1 thenedit1.Top:=rect.Top;edit1.Left:=rect.Left;edit1.Width:=rect.Right-rect.Left;edit1.Height:=rect.Bottom-rect.Top;edit1.Parent:=ListBox1;end;procedure TForm1.FormCreate(Sender: TObject);beginListBox1.Style:=lbOwnerDrawFixed;end;end. 可以的,代码: with TEdit.Create(ListBox1) do begin left:=0; top:=0; parent:=listbox1; visible:=true; end; 我如何扩展或重载listbox的items.insert方法???? 我想在设计期就看见效果!!!!!!每加一个Item就加一个Edit..........!!!!!!!!!?????????高手何在????????????? delphi7怎么设置一个有颜色属性的按钮控件? 再问sendmessage 请问Delphi中如何进行多线程的编程呀,如何同步? 如果程序最小化,是否还可以控制鼠标,使它在屏幕的特定位置移动? 谁有可垂直居中的QRLabel? 控件安装问题!!!急死我了~~ 高分解决问题 20分,容易的字符串处理问题! 关于TadoDataset的简单问题? 动态结构体如赋值 delphi 有没有替换字符串中指定字符串的函数?类似vb的replace ? 如何用程序知道机器是否连接到网络?
我只是想把他做成小控件,以后用着方便。以下是全部代码大家可以借鉴一下:高手快来帮忙啊!!!!!!unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;type
TForm1 = class(TForm)
ListBox1: TListBox;
Edit1: TEdit;
procedure ListBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
begin
if index=1 then
edit1.Top:=rect.Top;
edit1.Left:=rect.Left;
edit1.Width:=rect.Right-rect.Left;
edit1.Height:=rect.Bottom-rect.Top;
edit1.Parent:=ListBox1;
end;procedure TForm1.FormCreate(Sender: TObject);
begin
ListBox1.Style:=lbOwnerDrawFixed;
end;end.
with TEdit.Create(ListBox1) do
begin
left:=0;
top:=0;
parent:=listbox1;
visible:=true;
end;
每加一个Item就加一个Edit..........!!!!!!!!!?????????
高手何在?????????????