怎样在运行时打开listbox的items对话框,增加项目 ,在线等...
如题:在程序运行时,通过一按钮打开listbox1的items列表框,动态增加item值,怎样实现呀?????????、、
[解决办法]
ListBox1.AddItem( '这样 ', nil);
ListBox1.Items.Add( '或者这样 ');
[解决办法]
在窗口Create时,把原来的加载进来,就有了
self.Memo.Text := frmmain.ListBox1.Items.Text ;
[解决办法]
楼主看清了:伴水清清,是让你动态创建模式窗口,用完后释放。
uses Unit2;
procedure TForm1.Button1Click(Sender: TObject);
var
Form2 : TForm2;
begin
if not Assigned(Form2) then
begin
Form2 := TForm2.Create(nil);
Form2.Memo1.Text := ListBox1.Items.Text;
Form2.ShowModal;
ListBox1.Items.Text := Form2.Memo1.Text;
FreeAndNil(Form2);
end;
end;