Fluent.Ribbon icon indicating copy to clipboard operation
Fluent.Ribbon copied to clipboard

How to disable word wrap in button header?

Open balkarov opened this issue 5 years ago • 6 comments

Hello. thank you for your library! How to disable word wrap in button header? image

I want to see one line. Thank you!


Environment

  • Fluent.Ribbon v6.1.0.326
  • Windows 10
  • .NET Framework 4.6.2

balkarov avatar Jun 21 '19 10:06 balkarov

@batzen could you help me?

balkarov avatar Jul 09 '19 10:07 balkarov

Thats currently not possible from the outside. What should happen instead? Should the button get wider?

batzen avatar Jul 11 '19 16:07 batzen

I want control textbox size in button. For example set width so words will be inline

balkarov avatar Jul 15 '19 07:07 balkarov

That's currently not possible because there are no properties to control that. You could inherit from button and use OnApplyTemplate to get the inner controls. The template part you are interested in is called controlLabel. That control is a Fluent:TwoLineLabel and has a property called HasTwoLines which you would want to set to false.

batzen avatar Aug 07 '19 17:08 batzen

That's currently not possible because there are no properties to control that. You could inherit from button and use OnApplyTemplate to get the inner controls. The template part you are interested in is called controlLabel. That control is a Fluent:TwoLineLabel and has a property called HasTwoLines which you would want to set to false.

Hello I know some other languages, but WPF is a beginner. I'm experiencing the same this issue. Is the only way to solve this issue is to inherit the button as you describe? If XAML designers use RibbonTwoLineText.HasTwoLine as false, it will still be has word wrap. image image best regards

Ozymandias1 avatar Aug 06 '21 16:08 Ozymandias1

You can use a non breaking space (  in XAML or \u00A0 in C#) instead of a regular space. As the code in TwoLineLabel only looks for regular spaces it won't break at a non breaking space character.

batzen avatar Nov 26 '21 21:11 batzen