late binding error

  • Thread starter Thread starter Dean Slindee
  • Start date Start date
D

Dean Slindee

Can someone explain how to remedy the two late binding errors below when
Option Strict On:

Public Function ControlDataRowArrayListPaint(ByRef frm As Form, _

ByRef ctl
As Control, _

ByRef dr
As DataRow, _

ByRef
arrControl As ArrayList) As Integer

Dim tag As String

Dim int As Integer = 0

For int = 0 To arrControl.Count - 1

tag = arrControl(int).tag 'LATE BINDING ERROR

arrControl(int).Checked = True 'LATE BINDING ERROR

Next

End Function



Each form that calls this function has the following define:

Friend ctlArray As ArrayList = New ArrayList(0)

Thanks,

Dean Slindee
 
Dean Slindee said:
Can someone explain how to remedy the two late binding errors below when
Option Strict On:

Public Function ControlDataRowArrayListPaint(ByRef frm As Form, _

ByRef ctl
As Control, _

ByRef dr
As DataRow, _

ByRef
arrControl As ArrayList) As Integer

Dim tag As String

Dim int As Integer = 0

For int = 0 To arrControl.Count - 1

tag = arrControl(int).tag 'LATE BINDING ERROR

\\\
tag = DirectCast(arrControl(int), Control).Tag
///
arrControl(int).Checked = True 'LATE BINDING ERROR

\\\
If TypeOf arrControl(int) Is CheckBox Then
DirectCast(arrControl(int), CheckBox).Checked = True
End If
///
 
Back
Top