Page 1 of 1

determine text component witdth

Posted: Thu Apr 28, 2022 12:11 pm
by dmasterplan
Hello,

How can I determine the text component width depending on the content when ran/previewed?

Sample:
Run/Preview: ThisTwentyTextsAndASampleWidthOfFivePointSix
So, when the width is 5.6, the text won't fit and will be cut. I want it to wrap and assign the adjusted width to a variable?

Is this possible?

Please, I really need to resolve this.

Great Thanks!

Re: determine text component witdth

Posted: Thu Apr 28, 2022 12:38 pm
by ulli82
System.Windows.Forms.TextRenderer.MeasureText

Re: determine text component witdth

Posted: Thu Apr 28, 2022 1:18 pm
by dmasterplan
Okay. I'll do it now.
AND Thanks a lot for answering my question.

Re: determine text component witdth

Posted: Sat Apr 30, 2022 6:09 am
by Max Shamanov
Hello,

You are welcome!