本文介绍了VB6 DataGrid书签错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 当我向下滚动DataGrid,然后在DataGrid中选择一行,然后重新绑定DataGrid时,DataGrid显示从第一行开始的行,DataGrid.Row = 0. 如何重新定位DataGrid以显示上次选择的行? DataGrid绑定到DataEnvironment中的Command。 br /> 我在DataGrid.SelChange事件中尝试了以下代码,使用BookMarks属性,其中lastRow被声明为Variant:When I scroll down a DataGrid, then select a row in the DataGrid, then rebind the DataGrid, the DataGrid displays the rows starting with the very first row, DataGrid.Row = 0.How do I reposition the DataGrid to display the row that was last selected?The DataGrid is bound to a Command in the DataEnvironment.I have tried the following code in the DataGrid.SelChange event, using the BookMarks property, where lastRow is declared as a Variant:DataGrid1.Col = 0lastRow = DataGrid1.Texti = DataGrid1.RowDataGrid1.Bookmark(i) = lastRow 当我运行代码时,我在最后一行收到错误: 运行时错误'13':类型不匹配 知道我做错了吗? 谢谢。 [edit]已添加代码块[/ edit]推荐答案您已经在 http://www.codeproject.com/Messages/4595853/VB6 cannotGrid-Bookmark-Error.aspx [ ^ ]。请不要在多个论坛中发布相同的问题。You already asked this question at http://www.codeproject.com/Messages/4595853/VB6-DataGrid-Bookmark-Error.aspx[^]. Please do not post the same question in multiple forums. 这篇关于VB6 DataGrid书签错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 07-31 19:35