Late binding syntax error with Option Strict On

D

Dean Slindee

Not sure how to fix this syntax error when Option Strict On is enforced.
Can anyone help?
Dim ctl As Control

Dim sa() As String

For Each ctl In pnlParameter.Controls

sa = ctl.Tag.Split("="c) 'late binding error

Next

Thanks,

Dean Slindee
 
H

Herfried K. Wagner [MVP]

Dean Slindee said:
Not sure how to fix this syntax error when Option Strict On is enforced.
Can anyone help?
Dim ctl As Control

Dim sa() As String

For Each ctl In pnlParameter.Controls

sa = ctl.Tag.Split("="c) 'late binding error

\\\
sa = DirectCast(ctl.Tag, String).Split("="c)
///
 
K

Ken Tucker [MVP]

Hi,

sa = ctl.Tag.tostring.Split("="c)

Ken
-------------------
Not sure how to fix this syntax error when Option Strict On is enforced.
Can anyone help?
Dim ctl As Control

Dim sa() As String

For Each ctl In pnlParameter.Controls

sa = ctl.Tag.Split("="c) 'late binding error

Next

Thanks,

Dean Slindee
 
C

Chris Dunaway

If you're sure that the Tag property will always return a string, you
could try this:

sa = ctl.Tag.ToString.Split("="c)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top