首先在窗口中添加一个listview控件,方法:菜单->工程->部件->microsoft window common control 6.0 (后面为版本号)。再添加一个picture控件,改名为picgreenbar。
实现的代码如下: option explicit private sub form_load() dim i as integer dim ifontheight as long dim ibarheight as integer dim j as integer dim itmx as listitem dim colhead as columnheader listview1.columnheaders.add , , "this is just a simple example" listview1.columnheaders(1).width = 3000 '添加一些实验数据 for j = 1 to 33 set itmx = listview1.listitems.add() itmx.text = "this is item number " & cstr(j) next j me.scalemode = vbtwips picgreenbar.scalemode = vbtwips picgreenbar.borderstyle = vbbsnone picgreenbar.autoredraw = true picgreenbar.visible = false picgreenbar.font = listview1.font ifontheight = picgreenbar.textheight("b") + screen.twipsperpixely ibarheight = (ifontheight * 1) picgreenbar.width = listview1.width '====== picgreenbar.height = ibarheight * 2 picgreenbar.scalemode = vbuser picgreenbar.scaleheight = 2 picgreenbar.scalewidth = 1 'draw the actual bars picgreenbar.line (0, 0)-(1, 1), vbwhite, bf picgreenbar.line (0, 1)-(1, 2), rgb(227, 241, 226), bf '====== listview1.picturealignment = lvwtile listview1.picture = picgreenbar.image end sub 代码量不多,不过很实用。Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器