Dynamic Dialog Box Creation?

Dynamic Dialog Box Creation?

Is it possible to have VF create a dialog box "on the fly"?

For example, I would like to vary the number of EditBoxes that appear in a Dialog depending upon other data in my simulations.

Couldn't find the topic (maybe "recognize" is more like it) in Norm Lawrence's book. Just a mild shove in the direction of a good reference for this topic -- or the right words to use to describe what I need -- would be very helpful.

Thanks very much and God bless!

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Is the max number of edit boxes finite and known beforehand?
If so, just include them in the dialog and disable them until needed, or make them invisible until needed, or
make up seperate dialog boxes with different number of edit controls up to the max number and switch between them as required. You will of course have to have the call-backs available beforehand for each 'added' edit box control.

If the number can balloon in an unknown way then the dialog boxes will not be user-friendly.

The solution Tony suggested is really far simpler than creation on the fly. Even if number of boxes can grow to a large number, you could create a dialog with, say, ten boxes and a scrollbar; scrollbar position determines to which position you read/write although you still use the same 10 boxes.

I did this before. An application of mine is downloadable
from here. Go to "Download" page (the web is framed so there's no direct url) and download NSBK.exe; do a File/New, type, say, "28" number of pairs, then select "Custom" Movement type, then press "Edit...". I can send you the code fragments for that dialog if you're interested (my mail address is on the web).


Tony and Jugoslav,
Thanks very much for your expert tips. I had already been down the path that Tony suggests, using a lot of various-sized dialog boxes.

I was hoping there is some way I could create some kind of run-time-adjustable "derived type" or "structure" that might be able to stitch together several instances of my basic dialog template.

Lacking that, Jugoslav's NSBK.exe use of the scrollbar makes a very nice tool, and seems a good second choice. Thanks for the offer -- I'll reach you via your website for the code fragments.

However, if anyone knows of a way to extract and manipulate the dialog box properties within Visual Fortran, especially its "ownership" of text boxes and their locations, I'd sure like to hear.

Thanks again very much, and God bless!

Leave a Comment

Please sign in to add a comment. Not a member? Join today