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)
 

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


Back
Top