| 发表于:2007-08-15 22:32:12 楼主 |
问题1:如何刷新? (因为“编码”的值在随时发生变化,所以vsflexgrid1中对应的图片也要随值而变化。) 我目前使用的方法是:再次调用所有代码sx(),请问有没有其他的刷新方法? 问题2:刷新后如何不改变焦点(光标)的位置? (我用键盘的方向键在vsflexgrid1表格上移动焦点(光标),如果我目前将焦点的位置停留在表格的某个位置上,刷新后能否不改变焦点的位置,依然停留在刚刚的位置上。) function sx() call hao sql = "select * from www " rs.open sql, cn, 1, 1 while not rs.eof vsflexgrid1.rows = vsflexgrid1.rows + 1 vsflexgrid1.row = vsflexgrid1.rows - 1 vsflexgrid1.col = 1 vsflexgrid1.text = rs( "编码 ") '根据(rs( "编码 "))值在vsflexgrid1中显示imagelist1控件对应的图片 select case trim(rs( "编码 ")) vsflexgrid1 case "n " set vsflexgrid1.cellpicture = imagelist1.listimages(1).picture case "y " set vsflexgrid1.cellpicture = imagelist1.listimages(2).picture case "o " set vsflexgrid1.cellpicture = imagelist1.listimages(3).picture end select rs.movenext wend call rong end function |
|
|
|
|