First, I'am Sorry. I'm not good at English.
I'm making custom messagebox. I want to change messagebox form size in case of UltraLabel text overflow. But, I don't know what to do.
I tried the following a way.
Form.AutoSize = true;
Form.AutoSizeMode = AutoSizeMode.GrowAndShrink;
Panel.AutoSize = true;
Panel.AutoSizeMode = AutoSizeMode.GrowAndShrink;
Label is in the Panel.
Help me, What should I do ?
I think you should calculate the size of text using WinApi functions. Or other methods, for example: https://social.msdn.microsoft.com/Forums/vstudio/en-US/9855d7e6-264e-4d1f-bd7d-35381732d8c7/how-to-calculate-the-width-and-height-of-a-string-in-c-class-library?forum=csharpgeneral
Then you can calculate the size of label that is should be. Next having that size you can resize your form.