473,386 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 1459
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: JD Kronicz | last post by:
Hi .. I have an issue I have been beating my head against the wall on for some time. I am trying to use late binding for MS graph so that my end users don't have to worry about having the right...
9
by: Zlatko Matiæ | last post by:
I was reading about late binding, but I'm not completely sure what is to be done in order to adjust code to late binding... For example, I'm not sure if this is correct: early binding: Dim ws...
3
by: Thomas Müller-Lynch | last post by:
How can I avoid late binding with the directive strict = tru My ASP .net-file looks like this <%@DEBUG=true TRACE=true Strict=false EXPLICIT=true% .. dim footerValues as Arra footerValues =...
30
by: lgbjr | last post by:
hi All, I've decided to use Options Strict ON in one of my apps and now I'm trying to fix a late binding issue. I have 5 integer arrays: dim IA1(500), IA2(500), IA3(500), IA4(500), IA5(500) as...
1
by: Dean Slindee | last post by:
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...
21
by: ManningFan | last post by:
I need to use late binding in a project because it's company standard to not include references which aren't MS defaults, so I can't add the scripting runtime. I need to be able to search...
1
by: Adotek | last post by:
Hi All, I've just converted a solution from .Net v1.1 to v2.0, by allowing Visual Studio 2005 to do the conversion. Since doing so, I am getting a compilation error as follows: "Option...
2
by: GS | last post by:
I have installed the ms PIA for ofc XP, and followed the article http://support.microsoft.com/kb/247412/ trying to paste into a worksheet However I got late binding not allowed errors .......
15
by: tshad | last post by:
I have the following in my VS 2008 code: parameters(0).Value = Session("User").CompanyID I assume this means that since there is no "User" at this point I can't do this. But it will be...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.