请问:怎样在窗体加载时创建9百9十9万9千9百9十9个(9999999)个CheckBox控件并显示出来。
用代码创建。
我做了一个
运行了半个多小时那个窗体都还没有显示出来。
有谁有更好的跟快的解决办法吗?
大哥大姐们帮忙呀!谢谢!
用代码创建。
我做了一个
运行了半个多小时那个窗体都还没有显示出来。
有谁有更好的跟快的解决办法吗?
大哥大姐们帮忙呀!谢谢!
解决方案 »
- 请问,fastreport如何即打即停
- 如何在查询(TADOQuery)中新增字段,并可以显示及修改值,从别的表计算统计中得出其值
- 反三角函数是什么?arcsin(double)不对!
- 如何判断一个控件是否在groupbox内?
- Delphi中SQL Server指针的问题
- 做了一个单机版的小软件,做完之后,如何把它移植别的机器上运行啊?
- 我竟然不知道面向过程和面向对象的不同之处和个有什么优缺点????
- delphi里有没有测试一个8位字符串是否为合法的日期的函数
- ODBC连接数据库(SQL Server)的系统权限问题(急呀!!!!!)
- 如何使用二个adoQury实现Master/Detail表关系,请详细说明最好给出例子.
- 二进制的 0.01010000000000000000000怎么转为0.3125
- WebBrowser问题
9987
9988
未处理的“System.ComponentModel.Win32Exception”类型的异常出现在 system.windows.forms.dll 中其他信息:创建窗口句柄时出错。
--------------------------
Determines whether the list box is standard or owner-draw and whether it is virtual.type TListBoxStyle = (lbStandard, lbOwnerDrawFixed, lbOwnerDrawVariable, lbVirtual, lbVirtualOwnerDraw);
property Style: TListBoxStyle;DescriptionUse Style to specify whether the list box is a standard list box that displays text strings, or an owner-draw list box that can display graphical images. Owner-draw list boxes let you display items in some nonstandard way. In this case, you must write the code to paint items in the list box. In addition, Style controls whether the list box is virtual, which means that items are supplied dynamically using event handlers. By default, Style is lbStandard, meaning that the list box is not virtual and it displays each item as a string.
---------------------------
lbVirtual The list box is virtual, but all items are strings with the same height. You must indicate the number of items in the list box by setting the Count property. You must supply the items in the list box using an OnData event handler. If the items have associated objects, you must supply them using an OnDataObject event handler. In addition, you must supply an OnDataFind event handler to provide the mapping from the strings in the list box to their indexes.可见,TCheckListBox可以实现你所说的功能。将style设为lbVirtual,然后分别在OnDataObject、OnData、OnDataFind里写相应代码。这些列表项目不是直接添加到列表里去的,而是在需要显示的时候指定数据。这个速度很快的,可以处理数据量很大的情况。
var
MyCheckBoxs:array of TCheckBox; //全局变量........
........procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
setlength(MyCheckBoxs,9999999);
for i:=low(MyCheckBoxs) to high(MyCheckBoxs) do begin
MyCheckBoxs[i]:=TCheckBox.Create(Self);
MyCheckBoxs[i].Parent:=Self;
MyCheckBoxs[i].Caption:=Inttostr(i);
MyCheckBoxs[i].Left:=5;
MyCheckBoxs[i].Width:=30;
MyCheckBoxs[i].Top:=15*i;
MyCheckBoxs[i].Visible:=true;
end;
showmessage('ok')
end;
本回复由大傻的破玩意儿【CSDN's forum Explorer】完成!
软件功能强大,速度超快!!支持中...
软件下载地址:http://CoolSlob.ys168.com
这几个OnDataObject、OnData、OnDataFind事件怎么用!
我看了帮助没有看明白
还有批发CheckBox控件的
好家伙