> > I want to mimic the behaviour of the msgbox which automatically > > expands its > > height depending on the amount of text. Is there a parameter for > > the height of > > a statictext that takes into account the actual text in it (so > > "abc" is > > different than "It was the best of times, it was the worst of > > times.....................They lived happily ever after. The End."? > > What is wrong with using the MsgBox, or even better yet the > MessageDialog class. Unless you want to add your own controls (such > as a PopupMenu, ProgressBar, etc...) these classes work fine and > include a fair amount of customization. > > But to answer your question... > > Use a Graphics object, either the Window.Graphics, a Picture or a > Canvas and set the TextSize, TextFont, Bold and Italic properties to > match your StaticField. Then use Graphics.StringHeight(myString, > myStaticText.Width) to find out the height required to display all of > the text. Then set your StaticText field height to this value and > adjust the height of the Window accordingly. >
Thanks Phil. I have been using standard Msgbox's to notify the user that a transaction was completed successfully. However, its annoying to have to click "OK" each time. So I made a little window with a 3 second timer that will display then get out of the way without user action. Can I alter a regular message box to do that? Greg _______________________________________________ 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>
