private Infragistics.Win.UltraWinTabControl.UltraTabControl ultraTabControl1; in mytabcontrol.designer.cs file.
In this case at design time it is not possible to switch tabs, add controls to tabs or implement any UI actions on the UktraTabControl.
In order to "deliver" Click to the UltraTabControl I create MyDesigner that inherits from ParentControlDesigner and attach it to the MyTabControl.
Then, I override GetHitTest(), check if my mouse click happens withing tab rectangle and return true, which suppose to "deliver" Click to the UltraTabControl.
This approach does Not work with UltraTabControl, but works with Windows TabControl.
How do I do that for UltraTabControl?
Is there any other approach to get UI functionality at design time for wrapped UltraTabControl ?
Thank you
I tried going down a few paths to implement a designer for a wrapped UltraTabControl, but it results in many problems. I would suggest trying to find an alternate approach for this.
I have an UltraTabControl in an User Control, too. The designer now switches the tabs. I got it working by implementing a Designer-file which overrides the wndproc:
protected override void WndProc(ref System.Windows.Forms.Message m) { switch (m.Msg) { case 0x0201: // WM_LBUTTONDOWN case 0x0202: // WM_LBUTTONUP UserControlTabs tabs = this.Component as UserControlTabs; if (tabs == null) goto default; Point point = new Point((int)m.LParam); int index = tabs.IndexFromPoint(point.X, point.Y); if (index >= 0) { if (m.Msg == 0x0201) { tabs.SelectedIndex = index; tabs.ShowSiblings(); ISelectionService sel = (ISelectionService)GetService(typeof(ISelectionService)); if (sel != null) { sel.SetSelectedComponents(new object[] { tabs }, SelectionTypes.Replace); } } break; } else goto default; default: base.WndProc(ref m); break; } }
Do you see any problem here?
You will have a problem if the UltraTabControl is not aligned otthe top-left corner of theUserControl. Also, I think you might have a problem when trying to add control to the tabs at design-time. And I don't think you will get the context menu for the UltraTabControl at design-time.