1
Answer

Invalid Cast

Jonathen Scalet

Jonathen Scalet

18y
2.5k
1
I am trying to access a dynamically created control ( a tabpage ) with the following code:

((ListView)this.tabControl1.TabPages[1].Controls[1]).Items.Add("HELLO");

I am getting an error:
Specified cast is not valid.


What am I doing wrong?

Thanks,
Jon
Answers (1)