Hi allAttached I have a picture:First picture, selected tab is blue, other tab is black.Second picture: This is what I like to have.There should be a little line under the header. Color like selected tab. Is this possible to do with the ultraTabControl ?If yes, what settings I have to set ?Thanks and best regardsFrank Uray
Hi BorisThanks for the quick answer.The "merged" class works fine.How about this little vertical line ?Thanks and best regardsFrank Uray
Hello Frank,
I hope that I got your requirement right, please take a look at the following class, I did not make any changes to your code, just kind of 'merged' the two classes into one:
public class TabLine : Infragistics.Win.IUIElementDrawFilter { private System.Drawing.Color private_LineColor = System.Drawing.Color.Red; public TabLine(System.Drawing.Color _LineColor) { private_LineColor = _LineColor; } public bool DrawElement(Infragistics.Win.DrawPhase drawPhase, ref Infragistics.Win.UIElementDrawParams drawParams) { if (drawPhase == Infragistics.Win.DrawPhase.BeforeDrawFocus) return true; else { drawParams.Element.Rect = new System.Drawing.Rectangle(drawParams.Element.Rect.Location, new System.Drawing.Size(drawParams.Element.Rect.Width, 5)); drawParams.Graphics.FillRectangle(new System.Drawing.SolidBrush(private_LineColor), drawParams.Element.Rect); return false; } } public Infragistics.Win.DrawPhase GetPhasesToFilter(ref Infragistics.Win.UIElementDrawParams drawParams) { if (drawParams.Element is Infragistics.Win.UltraWinTabs.TabLineUIElement) { return Infragistics.Win.DrawPhase.AfterDrawElement; } else if (drawParams.Element is Infragistics.Win.UltraWinTabs.TabItemUIElement) return Infragistics.Win.DrawPhase.BeforeDrawFocus; return Infragistics.Win.DrawPhase.None; } }
Hi DankoSorry for the delay, was quite busy.I have just tried it out and it works fine, just the hight of the line does not work but this is no Problem.Interesting is also this Little vertical line at the beginning of the line (see attachment).But, there is a little additional Problem.I already set a drawfilter for this control (NoFocusRect).Is it possible to Combine these two drawfilters ?Following I send you the two classes, each of them work, but not together.Thanks for your effort !RegardsFrank Uray
public class NoFocusRect : Infragistics.Win.IUIElementDrawFilter {
#region Implementation of IUIElementDrawFilter
public bool DrawElement(Infragistics.Win.DrawPhase drawPhase, ref Infragistics.Win.UIElementDrawParams drawParams) { return true; }
public Infragistics.Win.DrawPhase GetPhasesToFilter(ref Infragistics.Win.UIElementDrawParams drawParams) { return Infragistics.Win.DrawPhase.BeforeDrawFocus; }
#endregion }
public class TabLine : Infragistics.Win.IUIElementDrawFilter {
private System.Drawing.Color private_LineColor = System.Drawing.Color.Red;
public TabLine(System.Drawing.Color _LineColor) { private_LineColor = _LineColor; }
public bool DrawElement(Infragistics.Win.DrawPhase drawPhase, ref Infragistics.Win.UIElementDrawParams drawParams) { drawParams.Element.Rect = new System.Drawing.Rectangle(drawParams.Element.Rect.Location, new System.Drawing.Size(drawParams.Element.Rect.Width, 5)); drawParams.Graphics.FillRectangle(new System.Drawing.SolidBrush(private_LineColor), drawParams.Element.Rect); return false; }
public Infragistics.Win.DrawPhase GetPhasesToFilter(ref Infragistics.Win.UIElementDrawParams drawParams) { if (drawParams.Element is Infragistics.Win.UltraWinTabs.TabLineUIElement) { return Infragistics.Win.DrawPhase.AfterDrawElement; } return Infragistics.Win.DrawPhase.None; }
}
I am still following this forum thread.
Please feel free to let me know if you still need assistance with this matter.
There is another way to achieve what you are looking for here. There is TabLineUIElement, which is drawn on the exactly desired place. You would need to access it, modified it a little and it will be drawn there. In the example below is used DrawFilter to achieve this functionallity:
class Class2 : IUIElementDrawFilter { public bool DrawElement(DrawPhase drawPhase, ref UIElementDrawParams drawParams) { drawParams.Element.Rect = new Rectangle(drawParams.Element.Rect.Location, new Size(drawParams.Element.Rect.Width, 3)); drawParams.Graphics.FillRectangle(new SolidBrush(Color.Black), drawParams.Element.Rect); return false; } public DrawPhase GetPhasesToFilter(ref UIElementDrawParams drawParams) { if (drawParams.Element is TabLineUIElement) { return DrawPhase.AfterDrawElement; } return DrawPhase.None; } }
Once you are done with it, you should assign an instance to the DrawFilter property of the Tab control. Please feel free to let us know if you need any further with this matter.