Hi everyone.
As far as I understand, each tab has its own UltraTabPageControl that holds the controls of the tab. When inserting a new tab by tabControl.Tabs.Add(str key, str text) the tab gets created with its UltraTabPageControl which is accessible by tab.TabPage. If I now add a simple control to the TabPage (.Controls.Add()) the UltraTabPageControl gets deleted which messes up things for me.
I already described that in detail on stackoverflow. I really hope it is ok to reffer my question from there as I already spend time to bring all informations into it.
http://stackoverflow.com/questions/41739070/ultratabcontrol-add-tabs-dynamically
Unfortunately I rather think this is a bug. I would be happy if you could tell me something else.
I appreciate every help in here, thank you very much.
Hi Thomas,
Thanks for linking me to your question on StackOverflow. I've read it over and the issue itself seems straightforward. I'm investigating it now and I will update you as soon as I find out what's happening to the TabControlPage, and no later than the 24th.
Please let me know if you have further questions.
I believe that this is an inheritance issue. The tab page and button control are not accessible on the inherited form because they are encapsulated within the base form's tab control. Since everything belongs to the base form, it is expected that it cannot be modified in the inherited form.
Does this match your expectation?Does this prevent you from completing your application requirements?
As a test, I added the following code to the base form's designer.cs so it would take effect on the designer surface:
System.Windows.Forms.Button btn = new System.Windows.Forms.Button(){ Size = new System.Drawing.Size(100, 100), Text = "Test" };ultraTabControl1.Tabs.Add("KEY1", "TAB1").TabPage.Controls.Add(btn);
Using this method, the tab page and button were both accessible in the designer. Note that it is not recommended to manually modify an autogenerated file, as VS expects to have complete control over it and may unexpectedly remove your code.
Please let me know if there is anything I can do to assist you.
I tested the behaviour of other containers like a panel. It looks like you are right. In order to archive what I was going for, I would have to define my controls as public globals. So its for sure an issue with the inheritance.
Thanks anyway for taking a look into.
Greetings.