Hi,
Is there a way to add a second image (aligned right) to an UltraTabControl?
Something like in the attached image.
Thanks!
Hello Ziv,UltraTabControl allows you to add image to any tab via its Appearance. However, by default you can add only one image. If you need to add more images, you can achieve this by some custom Creation Filter. What you need to do in your creation filter is add to TabItemUIElements’ child elements ImageUIElement and set its location. You may use code like this in AfterCreateChildElements method of your creation filter:
// If the parent is TabItemUIElement add one ImageElement to its child collectionif(parent is TabItemUIElement){ // Create the ImageUIElement var imageElement = new ImageUIElement(parent, tabImage); // Set the ImageUIElement Rect relative to its parent Rect imageElement.Rect = new Rectangle(parent.Rect.Right - 19, parent.Rect.Top + 3, 16, 16); // Add the ImageUIElement to its parent child elements collection parent.ChildElements.Add(imageElement);}
Note, this will add the image at the right end of each tab. This way the image may hide part of the tab text. To work around this you can add some additional blank text at the end of each tab like this:tabWithSecondImage.Text += " .";
Attached is small sample demonstrating this approach. Please check my sample and let me know if this is what you are looking for, or if I am missing something.
Hi Milko,
This is exactly what I was after - Thank you!
One small question - Is there any difference if we will use the DrawFilter mechanism to achieve this capability?
Is there any difference in performance between the two?
Thanks again!