So I am subclassing UltraTabPageControl, called TabPageModified. I had the following code:
{
addedTab.TabPage = tpm;
}
But for some reason I get a runtime error that says that TabPage is read only and will not allow me to asign tpm to it. However in another place in my code we do not have this issue and it runs fine. In order to fix this I had to do this:
addedTab.Key = tpm.Text;
addedTab.Text = tpm.Text;
this.tabControl1.Tabs.Add(addedTab);
I'm glad to get it working but am rather perplexed. Can you give any insight into why this is happening?
The TabPage property can only be set when it has not been set already. Adding the tab to a TabControls's Tabs collection will assign a default TabPage to the tab and prevent you from supplying your own. Try to set the TabPage property before adding the the tab to the control.