Invalid CastJSJonathen Scalet20yAsked Mar 29, 2006, 6:19 PM3kVisual Basic .NET 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
BTBrandon Turner20y agoPosted Mar 29, 2006, 9:29 PMthe control at position 1 in that tab is clearly not a listview. I would suggest trying to call it by its name or loop through all the controls and compare their types to see which one is the listview.0
Brandon TurnerPosted Mar 29, 2006, 9:29 PM