cad
cad

Reputation: 347

Winforms Label wrap hint for long string without spaces

A label displays a long string (letters and slashes, no spaces) in multiple lines. I want to control where possible line wraps should happen. Specifically after slashes wraps are desirable, whereas in other places not. I tried appending a zero-width space (unicode U+200B ZERO WIDTH SPACE) after each slash, but the label ignores these when determining the line wraps. Adding regular spaces results in the correct wrapping, but the spaces should not be visible.

Example how it looks:

This/is/a/long/tex
t/without/spaces/a
nd/wrong/wrapping

This is how it should look

This/is/a/long/
text/without/
spaces/and/wrong/
wrapping

Is it possible to add invisible wrap hints in a Winforms Label?

Upvotes: 1

Views: 467

Answers (0)

Related Questions