I want to use .GetText(Col As Integer, Row As Integer, ByRef var As Object) As Boolean method.
But when i use this method, runtime error always occured
I want to show you my code
With fGridview
For iCol = 1 To .MaxCols
For iRow = 1 To .MaxRows
.Col = iCol
.GetText(iCol, iRow, tmpVar)
If tmpVar = "0" Then
.SetText(iCol, iRow, "1")
End If
Next
Next
End with
As You can see, When iCol=1, iRow=1, It is ok. But When iCol=1, iRow=2, runtime error occured. i think why this happened is because of ByRef parameter.
If i used tmpVar=nothing like this
.GetText(iCol, iRow, tmpVar)
If tmpVar = "0" Then
.SetText(iCol, iRow, "1")
End If
tmpVar=nothing
, it works well. I don't know why this happen. Why do i have to use nothing in tmpVar, when i use ByRef parameter. i need your help plz.
and Type Missmatch error
this is vb 6.0 code
With fGridview
For iCol = 1 To .MaxCols
For iRow = 1 To .MaxRows
.Col = iCol
.GetText iCol, iRow, tmpVar
If tmpVar = "0" Then
.SetText iCol, iRow, "1"
End If
Next
Next
End With
p.s My english is not good. so i don't know if you can understand my word. anyway Thank you very much
According to this help on their site GetText requires as first parameter the ROW index and as second parameter the COLUMN index (The same is true also for SetText).
No third parameter is present. Are you mistakenly using the syntax required in VB6 instead of the one required for the NET component?
I could be wrong because I don't use this component, but perhaps you need to change your code in this way
Let me know if this fix your problem