Shoutbox

[?] Automatically Resize PlusWnds - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [?] Automatically Resize PlusWnds (/showthread.php?tid=78974)

[?] Automatically Resize PlusWnds by Spunky on 11-12-2007 at 04:53 PM

Is there any way to do it? I want to load text from a website of various lengths and have the window resize if nessacerry to accomodate it...


RE: [?] Automatically Resize PlusWnds by Ezra on 11-12-2007 at 07:21 PM

A quick search found me this thread=78300


RE: [?] Automatically Resize PlusWnds by Spunky on 11-12-2007 at 09:21 PM

But is there any way to determine the size of the text box contents (and easily)? Else when I change the size it won't be accurate. I think I might be able to resize the StaticControl to fit the contents and then find the height and add about 50 for the titlebar and bottom bar... Any idea how to do it?


RE: [?] Automatically Resize PlusWnds by Matti on 11-13-2007 at 04:58 PM

I found this on MSDN: How To Calculate a Bounding Rectangle For a of String Text. However, I guess it'll be very hard to re-create that piece of code in a MP!L script... :-/


RE: [?] Automatically Resize PlusWnds by Spunky on 11-13-2007 at 05:04 PM

You're right... I think it might be easier if I work out the maximum characters per line, work out the number of lines and the height of each line and then resize the window to that :-| lol


RE: [?] Automatically Resize PlusWnds by Matti on 11-13-2007 at 07:56 PM

Yeh, that would be the easiest way. However, you might want to look what is the widest character, because if I would type 5 underscores _____ it's lots wider than 5 dots .....

Good luck! (y)