3命令按钮的Click事件代码如下: &&往列表框中添加项目 ThisFormList1.List(1)=′MAIN.SCX′ ThisFormList1.List(2)=′FORM1.SCX′ ThisFormList1.List(3)=′DEMO1.DBF′ ThisFormList1.List(4)=′SALES.DBF′ ThisFormList1.List(5)=′TESTDATA.DBC′ ThisFormList1.List(6)=′MAIN.PRG′ ThisFormList1.List(7)=′MYFUNC.PRG′ ThisFormList1.List(8)=′SALES.FRX′ ThisFormList1.List(9)=′SS.FRX′ ThisFormList1.List(10)=′SALES.QPR′ N=ThisFormList1.ListCount FOR i=1 TO N &&从后缀名判断类型 cExtension=UPPER(RIGHT(ThisForm.List1.List(I),3)) &&bmp文件在当前目录下 DO CASE CASE cExtension=″DBF″ ThisForm.List1.Picture(I)=″table.bmp″ CASE cExtension=″PRG″ ThisForm.List1.Picture(I)=″apps.bmp″ CASE cExtension=″SCX″ ThisForm.List1.Picture(I)=″forms.bmp″ CASE cExtension=″DBC″ ThisForm.List1.Picture(I)=″database.bmp″ CASE cExtension=″FRX″ ThisForm.List1.Picture(I)=″report.bmp″ CASE cExtension=″QPR″ ThisForm.List1.Picture(I)=″query.bmp″ OTHERWISE ThisForm.List1.Picture(I)=″fox.bmp″ ENDCASE ENDFOR 执行的结果是在每一项目前都有与项目类型对应的图标。将列表框换成组合框(ComboBox)也能达到同样效果。