lothos12345
Junior Contributor
Late Binding
I have a program in VB.NET that requires that Option Strict be activated and it is giving me a late binding error. With Option Strict off there is not a probelm, however the requirement is that Option Strict be On. The code is a follows:
Private Sub ContextMenu1_clicked(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim sendnoteid As Integer
Dim tParent As String
Dim tchild As String
Dim tnote As String
Dim i As Integer
Try
' get group and replace active row cell with menu option
tnote = UltraGrid1.ActiveRow.Cells(2).Value.ToString
tParent = sender.Parent.Text.ToString ******error
tchild = sender.Text.ToString ******* error
'tchild = ContextMenu1.ToString
For i = 0 To UBound(afindtext)
If afindtext(i) = tParent & "*" & tchild Then
UltraGrid1.ActiveRow.Cells(2).Value = Replace(tnote, areplacetext(i), tchild)
i = UBound(afindtext)
UltraGrid1.ActiveRow.Cells(0).Value = True ' if checkbox not checked then check it
End If
Next
Catch ex As Exception
Call errhandler(ex.Message, ex.StackTrace, ex.Source)
End Try
End Sub
Not quite sure how to resolve this issue. As always any help would greatly be apprieciated.
I have a program in VB.NET that requires that Option Strict be activated and it is giving me a late binding error. With Option Strict off there is not a probelm, however the requirement is that Option Strict be On. The code is a follows:
Private Sub ContextMenu1_clicked(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim sendnoteid As Integer
Dim tParent As String
Dim tchild As String
Dim tnote As String
Dim i As Integer
Try
' get group and replace active row cell with menu option
tnote = UltraGrid1.ActiveRow.Cells(2).Value.ToString
tParent = sender.Parent.Text.ToString ******error
tchild = sender.Text.ToString ******* error
'tchild = ContextMenu1.ToString
For i = 0 To UBound(afindtext)
If afindtext(i) = tParent & "*" & tchild Then
UltraGrid1.ActiveRow.Cells(2).Value = Replace(tnote, areplacetext(i), tchild)
i = UBound(afindtext)
UltraGrid1.ActiveRow.Cells(0).Value = True ' if checkbox not checked then check it
End If
Next
Catch ex As Exception
Call errhandler(ex.Message, ex.StackTrace, ex.Source)
End Try
End Sub
Not quite sure how to resolve this issue. As always any help would greatly be apprieciated.
Last edited: