Custom message window

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I want to make a custom message window on my app, I want to fit my window
size to the number of lines on my string message. How can I do that? some
place with FAQs about.
 
Thanks for the article Morris that was a great help.

I already descovered the .MeasureString, using the .net Reflector I looked
inside the autosize property of a label to see how it works, and I see the
MeasureText as the core implementation.

I find the width of my message, and I divide it by the width of my window in
order to get the number of resulting lines for calculate the window's height.
But this doesn't work, because if a word is too longer for a line, the word
goes in the above line, and this increases the number of lines in the
resulting message and this is very hard to calculate, I'm wishing some .net
function to do that, if no, I think I will code a lot.

thanks.
 
Back
Top