This is a migrated thread and some comments may be shown as answers.

Remove/Change the white space in the middle of the word rapped text

1 Answer 189 Views
Label
This is a migrated thread and some comments may be shown as answers.
AIT
Top achievements
Rank 1
Veteran
AIT asked on 05 Aug 2020, 08:37 AM

Hello,

In Run Time, How to remove/change the white space in the middle of the word rapped text. Kindly refer to the screenshot. 

https://anilkumar-aitechindia.tinytake.com/tt/NDUxMjc0NF8xNDI5OTY2Mg

1 Answer, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 07 Aug 2020, 09:53 AM

Hello,

According to the attached picture, it seems that you have multi-line RadLabel and you would like to change the line spacing.

Note, text rendering uses Graphics. By default, Telerik Presentation Framework uses GDI+ to measure and render the text. You can easily switch to GDI instead by setting the UseCompatibleTextRendering property to false for the respective control. More information about text rendering in TPF you can find here: https://docs.telerik.com/devtools/winforms/telerik-presentation-framework/text-rendering

However, Graphics do not provide any direct mechanism to manage line-height, you need to manually calculate and render the same. Since this is more like a general programming question I made a research in general programming forums like StackOverFlow and MSDN and found out the following articles that might be useful on this topic:
https://stackoverflow.com/questions/342254/how-to-set-line-spacing-graphics-drawstring
https://docs.microsoft.com/en-us/dotnet/framework/winforms/advanced/how-to-obtain-font-metrics?redirectedfrom=MSDN
https://stackoverflow.com/questions/5068752/how-to-change-spaces-between-lines-in-winforms-label
https://stackoverflow.com/questions/24543630/how-can-i-customize-line-height-in-drawstring-and-sizef

I hope this information is useful. Should you have further questions regarding RadControls from the Telerik UI for WinForms suite please let me know.

Regards,
Nadya
Progress Telerik

Tags
Label
Asked by
AIT
Top achievements
Rank 1
Veteran
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or