OpenDialog at run-time?

bfan

Member
Licensed User
Hi,

how can an OpenDialog be added at run-time?

There are several add... (addButton, addListbox, etc.) but I can't find an addOpenDialog and I have tried to guess but I've failed.

Thanks.

Antonio
 

mjcoon

Well-Known Member
Licensed User
how can an OpenDialog be added at run-time?

There are several add... (addButton, addListbox, etc.) but I can't find an addOpenDialog and I have tried to guess but I've failed.

To take a step backwards, why would you want to?

OpenDialog is quite general purpose, in that it can be used to choose any number of file names, so you should only need one instance. (But the filter might have to be reset, admittedly.)

And it is entirely hidden until it is called; it does not really belong amongst the controls in that it does not have to be positioned clear of other controls. It is almost like a timer or the collections in that regard.

So, so long as you have at least one form that is created via the Designer, give it an OpenDialog!

Mike.
 

bfan

Member
Licensed User
I'm not using the Designer at all.

In my device, when I create a form in the designer I always get the form.width and form.height of a 320x240 device, so I can't say which device the program is running in.

I don't know whether a compiled version behave the same, but I develop entirely in my device.

Thanks.
 

Zenerdiode

Active Member
Licensed User
I'm not using the Designer at all.

You must be. Either the Device IDE or a Windows Desktop IDE. Unless you're editing the .sbp source with a text editor... :confused:

In my device, when I create a form in the designer I always get the form.width and form.height of a 320x240 device, so I can't say which device the program is running in.

It shouldn't matter as the OpenDialog will fill the screen anyway. I think you may have missed mjcoon's point that, although it appears on the form you can place any other controls directly on top of it. The OpenDialog is also a global control so may be invoked from any other form.

So you must have a Main form, stick it on there in the corner somewhere.
 

mjcoon

Well-Known Member
Licensed User
You must be. Either the Device IDE or a Windows Desktop IDE. Unless you're editing the .sbp source with a text editor.

I assumed that bfan does not have a form at all at the start of execution but creates the first form using AddForm(). Since I have never done (or wanted to do) this I have no idea of the implications...

Perhaps one answer would be to use a library version of OpenDialog but I don't know where that is off hand.

Mike.
 

bfan

Member
Licensed User
Yes, I use AddForm().

As I said, it is the only way I have found to get the real size of the form.

Antonio
 

bfan

Member
Licensed User
I had, but to be sure before answering to you, I have tried again and I have got the values according to the screen resolution.

May be I created the test program with the standard version and then I loaded and run again with the -vga version, but possibly I did not delete the form to create it again, so I got the QVGA values.

So, problem solved.

Thanks.

Antonio
 
Top