Private Sub Form_click()
 
  DataGrid1.Book = 50
  
End Sub报错:类型不匹配

解决方案 »

  1.   

    语法错误,Book为一数组,表示为DataGrid1.Book(行) = 50,其中行是从0到总行数-1
    见MSDN描述如下:——————————————————————————————————————Visual Basic: DataGrid ControlBook Property (DataGrid)
          Returns or sets a book for the specified row within a RowBuffer object in an unbound DataGrid control.Syntaxobject.Book (row) [= value]The Book property syntax has these parts:Part Description 
    object Anobject expression that evaluates to an object in the Applies To list. 
    row An integer specifying the row where the book is placed. The range of this value can be from 0 to RowCount – 1. 
    value A variant representing the book for the specified row. 
    ResUse the value returned by the Book property to save a reference to the current row that remains valid even after another row becomes current.When you set the Book property to a valid value in code, the row associated with that value becomes the current row, and the grid adjusts its display to bring the new current row into view if necessary.The Book property is defined as a Variant to accommodate user-defined books in unbound mode.In the UnboundReadData event there may be multiple rows, so you must provide a book for each row.The UnboundWriteData event passes a book to you to identify the row of data to be updated.The UnboundAddData event passes a book to you to identify the row of data to be added.Note   In unbound mode, setting the Book property to itself will force the current row to be updated via the UnboundWriteData event.
    --------------------------------------------------------------------------------
      

  2.   

    看见楼上帖了N次MSDN了....
      

  3.   

    我就是不会设置合法的属性,csdn我也会看啊,但是没有做好才拿来问嘛