468,290 Members | 1,964 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,290 developers. It's quick & easy.

another late binding error

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

Nov 21 '05 #1
2 1334
Hi,

Use DirectCast

tag = DirectCast(arrControl(int),Checkbox).tag

DirectCast(arrControl(int),CheckBox).Checked = True

Ken
--------------------

"Dean Slindee" <sl*****@charter.net> wrote in message
news:94******************@fe06.lga...
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


Nov 21 '05 #2
Thanks Ken for putting me on the right track

The second line works as stated. The first line should read:
tag = DirectCast(arrControl(int), Control).Tag.ToString

for anyone else reading.

Dean Slindee

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ei**************@TK2MSFTNGP10.phx.gbl...
Hi,

Use DirectCast

tag = DirectCast(arrControl(int),Checkbox).tag

DirectCast(arrControl(int),CheckBox).Checked = True

Ken
--------------------

"Dean Slindee" <sl*****@charter.net> wrote in message
news:94******************@fe06.lga...
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

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by JD Kronicz | last post: by
9 posts views Thread by Zlatko MatiŠ | last post: by
3 posts views Thread by Thomas M├╝ller-Lynch | last post: by
30 posts views Thread by lgbjr | last post: by
1 post views Thread by Dean Slindee | last post: by
1 post views Thread by Adotek | last post: by
15 posts views Thread by tshad | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.