why can't i access tabpage members as an object while i can as tabpage object
i was writing the following
if(this.tabControl1.TabPages.Count != ImagesList.Count())
{
foreach (var item in this.tabControl1.TabPages)
{
}
}
and i couldn't access the controls inside each item using item. but with a
defining it's type like
if(this.tabControl1.TabPages.Count != ImagesList.Count())
{
foreach (TabPage item in this.tabControl1.TabPages)
{
}
}
i could easily access them using item.Controls
so i was wondering why do i really need to define/cast those items as
tabpage, shouldn't the compiler/intellasense figure it out as each item
inside this.tabControl1.TabPages is actually a TabPage ?
No comments:
Post a Comment