Way to suppress automatic Label generation in BarCheckBox?

Bars for WPF Forum

The latest build of this product (v25.1.3) was released 2 months ago, which was before this thread was created.
Posted 3 days ago by Jason Trenouth
Version: 25.1.3
Avatar

Hi,

Background

I'm converting our application from Ribbon to Bars.

Problem

While changing to use the BarCheckBox in one particular place it seems as though we can no longer suppress the Label by setting Label="". (We actually wrap our own label on the other side of the control.) The control is now displayed with the Command name as the label. Presumably some code is using "IsNullOrEmpty" to decide whether to automatically generate a Label?

Question

Is there another way of suppressing the automatic Label generation?

I've tried using the Unicode zero width space for the Label but WPF still renders it as a visible space. It is possible that changing some rendering mode might fix that but I'd rather not fiddle with that if I don't have to.

Thanks in advance,

__Jason

Comments (2)

Posted 3 days ago by Jason Trenouth
Avatar

For the moment I am using the following:

<bars:BarCheckBox.Resources>
<Style TargetType="TextBlock">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
</bars:BarCheckBox.Resources>

But let me know if there is a better or more approved way.

Cheers,

__Jason

Answer - Posted 3 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Jason,

Thanks for catching and reporting that scenario.  We have found the problem and corrected it so only null Label values will trigger Label auto-generation from Key, Command, etc.  This update will be in the next build.

As part of those changes we also saw that when the Label is null or empty string, we need to hide the Label and reduce the padding around the check glyph a bit.  I think with your Unicode zero width space attempt in the meantime, you are seeing some of that extra Padding remain, which you could probably lessen by setting Padding="3".


Actipro Software Support

Add Comment

Please log in to a validated account to post comments.