Late binding syntax error with Option Strict On

  • Thread starter Thread starter Dean Slindee
  • Start date Start date
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
 
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)
///
 
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
 
If you're sure that the Tag property will always return a string, you
could try this:

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