>I'll look at it again then, thanks! What I've done so far is create a form that works as a messagebox and I pass the message, title, and button captions to the form. It works fine and I was able to resize the form and buttons based on the captions and size of the message, but rather than include the form in the project, I'd like to be able to save it as a class and add the code to a method of the calling form and run it that way. Is there anyway to do this that you know of?
Mmmmm... just look into alert.prg and tear it apart if you like. It does contain a definition of a form class, and it resizes as needed. There's one correction that's not posted yet, when sizing the buttons, it uses only two measures instead of three..
.buttons(i).height=fontmetric(1,g_fontname,g_fontsize)+;
fontmetric(2,g_fontname,g_fontsize)+;
fontmetric(3,g_fontname,g_fontsize)
is what it should be - current version lacks the last line, so the buttons turn out lacking some height.
I guess I've come somewhere halfway between procedural and OOP in this one - the form class is still in code, but then I feel it's still justified, because the code which is needed for wrapping the instantiation of the form is together with the class, so the call you need to make is still one-liner. Having this form class in a vcx would mean I'd have a few files more to include - simpler this way.
> I've never included one form definition inside another form, so I don't know if it is possible. I've always just added the form or class to the project.
You lost me here... not sure what you mean by "include one form definition inside another form".