Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4032
UltraTabControl: Notification badge settings for not covering tab-text
posted

I cannot find the correct notification badge settings that badge is not covering the tab-label (see image attached).

At design-time it looks better than runtime even it would be enough space for text and badge.

How I have to set the badge settings?

Than you for some advices.

Regards Markus

Designtime

Runtime

  • 34810
    Offline posted

    Hello Markus,

    I have been investigating into this behavior you are looking to achieve, and there is nothing in the badge settings that will help you to prevent the notification badge from overlapping the text. The notification badge is essentially an adorner that is added at runtime, and it is constrained by the width and height of the UI element that it is being show on. If there is not enough space on your tab to allow the notification badge to be placed without overlap, it will simply be placed over the text of the tab.

    There are a couple of things that you can do to prevent this. The first is to set the FixedWidth property of your tabs such that there is enough room for the notification badge. For example, you could use the following code to set your first tab’s width to 100 pixels:

    ultraTabControl1.Tabs[0].FixedWidth = 100;

    An alternative to this would be to set the Appearance.Image property of your tab to an empty image to add extra space to the tab, but if you are planning to use images on your tabs anyway, this may not be an option for you. For example, you could do something like the following:

    Bitmap bmp = new Bitmap(30, 30);
    ultraTabControl1.Tabs[0].Appearance.Image = bmp;

    I hope this helps. Please let me know if you have any other questions or concerns on this matter.