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
Hello Frank,
Looking at your screenshot, I can think of only one way to achieve this: you could set the 'Image' property of the 'Appearance' object of the desired tab. This picture will be black and blue at the bottom.
I wanted to know if you were able to solve your issue based on these suggestions or you still need help. Please let me know.
I am still following this forum thread.
Please feel free to let me know if you still need assistance with this matter.
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 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 BorisThanks for the quick answer.The "merged" class works fine.How about this little vertical line ?Thanks and best regardsFrank Uray
Could you please try to add the following line of code:
drawParams.Element.Offset(0, -4);
Between the two lines in the else clause, so it goes like this:
drawParams.Element.Rect = new System.Drawing.Rectangle(drawParams.Element.Rect.Location, new System.Drawing.Size(drawParams.Element.Rect.Width, 5)); drawParams.Element.Offset(0, -4); drawParams.Graphics.FillRectangle(new System.Drawing.SolidBrush(private_LineColor), drawParams.Element.Rect);
Yes, the values will depend on your exact scenario and control settings. I am glad to hear that you were able to solve this!
Please feel free to let me know if a question about our tool set comes up on your mind.
drawParams.Element.Offset(0, 0); works. :-)
Thanks and best regards
Frank Uray