Resize form depending on text length
<p>I'm developing a desktop application in C#, which shows pop-up messages every X quantity of time. For this, I'm using a library called <a href="http://benhollis.net/components/winforms/popupnotify/" rel="nofollow">PopupNotify</a>, and I'd like the label that contains the message(called NotifyMessage) to have a fixed width, and vertically enlarge on overflow.</p>

<p>There is an event in which they set this up, but I can't modify it to make it work. Here is the event's code:</p>

<pre><code>    private void SetLayout() 
    {
        int padding = 8;
        int iconRightPadding = 0;
        int border = 1;

        iconBox.Left = padding + border;
        iconBox.Top = padding + border;
        iconBox.Width = IconWidth;
        iconBox.Height = IconHeight;

    this.Height = iconBox.Height + 2 * padding + 2 * border;

    closeButton.Left = Width - padding - border - closeButton.Width + 3;
    closeButton.Top = padding + border - 3;

    NotifyTitle.Top = iconBox.Top - 5; //fudge factor
        NotifyTitle.Left = iconBox.Right + iconRightPadding;

    NotifyMessage.Left = NotifyTitle.Left + 1; //fudgy
        NotifyMessage.Width = Width - NotifyMessage.Left - padding - border;
        NotifyMessage.Top = NotifyTitle.Bottom;
        NotifyMessage.Height = Height - NotifyMessage.Top - padding - border;
    }
</code></pre>

<p>I've tried modifying it's logic, and the way it calculates its height by adding the NotifyMessage's height, and some other things, but none of them worked.</p>

<p>I'll appreciate any help on this.</p>
