On Jul 26, 2006, at 10:32 AM, [EMAIL PROTECTED] wrote:

On Jul 26, 2006, at 10:21 AM, [EMAIL PROTECTED] wrote:
Is there a cross-platform method of determining how long a StaticText control should be given the text inside?

Well, I haven't found a way to get a statictext lengthened properly, but I have found another way to crash the debug application (and the standalone, for that matter)

New Project
On the window, put an EditField and a PushButton
In PushButton1.Action, insert this code:

  Dim g As New Graphics

  EditField1.DrawInto g, 0, 0

  EditField1.Width = g.Width

Run it, type in some text, press the button, and poof!!! Your debug application crashes. This works for RB 2005r4 for OSX compiling for all platforms.

What would you expect it to do? A Graphics instance simply draws to something. By creating a new Graphics, you're drawing to nothing. There shouldn't be a way to create a Graphics instance by itself.

The proper thing to do is to create a temporary picture, or get a Graphics instance from the Window, Canvas, or existing picture.

HTH,
Jon


--
Jonathan Johnson
[EMAIL PROTECTED]
REAL Software, Inc.


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to