DelphiÖÐÓÃTListViewÏÔʾÊý¾Ý¿âÊý¾Ý
Ê×ÏÈ´´½¨Ò»¸öеÄÏîÄ¿£¬È»ºóÏò´°ÌåÉÏÌí¼ÓÒ»¸öTQuery×é¼þºÍÒ»¸öTListView×é¼þ.
¡¡ÉèÖÃTQuery×é¼þµÄDatabaseNameÊôÐÔÉèÖÃΪDBDEMOS£¬SQLÊôÐÔÉèÖÃΪselect * from country¡£È»ºóÌí¼Ó³ÌÐò³õʼ»¯´úÂëÈçÏ£º
with adoquery1 do
begin
close;
ADOConnection1:=TADOConnection.Create(nil);
Adoconnection1.LoginPrompt:=false;
ADOConnection1.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db1.mdb;Persist Security Info=False';
adoquery1.Connection := ADOConnection1;
SQL.Clear;
SQL.add('select * from BOSS');
Open;
end;
for i:=0 to adoquery1.FieldCount-1 do
begin
TempColumn:=self.ListView1.Columns.Add;
TempColumn.Caption:=adoquery1.Fields[i].FieldName;
end;
adoquery1.First;
while not adoquery1.Eof do
begin
TempItem:=self.ListView1.Items.Add;
TempItem.Caption:=adoquery1.Fields[0].AsString;
for i:=1 to adoquery1.FieldCount-1 do
begin
TempItem.SubItems.Add(adoquery1.Fields[i].AsString);
end;
adoquery1.Next;
end;
¡¡³ÌÐòÊ×ÏÈͨ¹ýListView1.ViewStyle:=vsReportÓï¾äÉèÖÃTListView×é¼þµÄViewStyleÊôÐÔֵΪvsReport¡£È»ºóͨ¹ýµÚ1¸öÑ»·ÖеÄTempColumn:=self.ListView1.Columns.AddºÍTempColumn.Caption:=Query1.Fields[i].FieldNameÓï¾äÔÚTListView×é¼þµÄ±êÌâÐÐÖÐÏÔʾÊý¾Ý¿âÖÐ×ֶεÄÃû³Æ¡£×îºóͨ¹ýÒ»¸öÑ»·ÖðÐÐÊä³öÊý¾Ý¿âµÄËùÓÐÊý¾Ý¡£
±£´æÎļþ£¬È»ºó°´F9¼üÔËÐгÌÐò
Ïà¹ØÎĵµ£º
ÎÒÒ»¿ªÊ¼ÒÔΪ£¬½«±íµ¥ÉèÖÃΪÒþ²Ø£¬¿ÉÒÔÔÚ±íµ¥´´½¨Ê¼þÖм´FormCreate(Sender:TObject)È¥ÉèÖÃ
Òò´Ë£¬ ÎÒÔÚÕâ¸öprocedure TForm.FormCreate(Sender:TObject)ÖУ¬
ÏëÓÃÒ»ÏÂÁ½ÖÖ·½Ê½ÊµÏÖ
¼´£º
µ÷ÓÃ from.Hi ......
ÄÚÈݼò½é
dbExpressÊÇBorland¹«Ë¾ÏÂÒ»´úÊý¾Ý·ÃÎʼ¼Êõ¡£±¾Êé²»½öÏêϸ½éÉÜÁËdbExpressµÄ»ù±¾¹¦ÄÜ¡¢Ê¹Óü¼ÇÉÒÔ¼°Delphi/KylixµÄDataSnap¼¼Êõ£¬»¹ÏêϸÌÖÂÛÁËdbExpressµÄʵÏÖÔÀíÒÔ¼°dbExpressµÄδÀ´·¢Õ¹Ç÷ÊÆ¡£±¾Êé½á¹¹ÇåÎú£¬½²½â͸³¹£¬ÊµÀý·á¸»¡£×÷ÕßÀîάÊÇBorland¹«Ë¾ÖøÃû¼¼Êõר¼Ò£¬ÔøÖøÓжಿDelphiÃû ......
ÒýÓÃ×Ô£ºhttp://develop.csai.cn/delphi/NO000001.htm
×Ô¶¯Íê³É¼ò½é
¡¡¡¡´ó¼ÒÒ»¶¨¶¼·Ç³£ÊìϤIEä¯ÀÀÆ÷µÄµØÖ·ÊäÈë±à¼¿ò£¬ËüÌṩÁË×Ô¶¯Íê³ÉµÄ¹¦ÄÜ¡£×Ô¶¯Íê³É£¨Auto Complete£©¹¦Äܼò»¯Á˱༿òµÄÊäÈ빦ÄÜ£¬Ëü¿ÉÒÔ¸ù¾ÝÒѾÊäÈëµÄ²¿·Ö×Ö·û´®½øÐÐÔ¤²âºÍÆ¥Å䡣ͼ2.7µÄÀý×Ó£¬ÑÝʾÁË×Ô¶¯Íê³É¿ÉÒÔÒÀ¾ÝÊäÈëµÄ“pro”£¬¸ø³ ......
savetime2k@yahoo.com 2004.1.28
http://savetime.delphibbs.com
½ñÌ쿪ʼѧϰԪ¼þ±à¼Æ÷£¬¸Ð¾õ±ÈÊôÐÔ±à¼Æ÷¼òµ¥Ðí¶à£¬µ«»¹ÊÇÓöµ½ÁËһЩÒÉÎÊ¡£Èç¹ûÄãÄܽâ´ðÎÄÖмǼµÄÎÊÌ⣬Çë¸æËßÎҴ𰸣¬Ð»Ð»£¡
Ŀ ¼
===============================================================================
¡Ñ TBaseComponentEdit ......