🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
5 messages
5 total messages Started by Christophe MINETTI Fri, 07 Dec 2007 15:19
OpenDialogBox and Inital Dir
#848
Author: Christophe MINETTI
Date: Fri, 07 Dec 2007 15:19
10 lines
1160 bytes
Hi,

I would like to tell an OpenDialogBox in which directory it must be
opened. For this, I use InitialDir which works fine the first time but
then if I change the InitalDir value with another path, it does not take
it into account. Is there any way to overcome this ?

Many thanks in advance.

Christophe
Re: OpenDialogBox and Inital Dir
#849
Author: Asger Joergensen
Date: Fri, 07 Dec 2007 15:41
27 lines
1449 bytes
Hi Christophe
 
 Christophe MINETTI says:
> Hi,
> 
> I would like to tell an OpenDialogBox in which directory it must be
> opened. For this, I use InitialDir which works fine the first time but
> then if I change the InitalDir value with another path, it does not take
> it into account. Is there any way to overcome this ?

Do You mean TOpenDialog ?

This might help:

TOpenDialog *OpenDialog = new TOpenDialog(NULL);
OpenDialog->InitialDir = "ThePath";
if(OpenDialog->Execute())
{
	// do stuff
}
delete OpenDialog;

This way You have a new one every time.

Kind regards
Asger
Re: OpenDialogBox and Inital Dir
#850
Author: Wookie
Date: Fri, 07 Dec 2007 17:05
32 lines
1610 bytes
Hi Asger,

Thanks for your help; it works as it should !

Asger Joergensen wrote:

> Hi Christophe
>
>  Christophe MINETTI says:
> > Hi,
> >
> > I would like to tell an OpenDialogBox in which directory it must be
> > opened. For this, I use InitialDir which works fine the first time but
> > then if I change the InitalDir value with another path, it does not take
> > it into account. Is there any way to overcome this ?
>
> Do You mean TOpenDialog ?
>
> This might help:
>
> TOpenDialog *OpenDialog = new TOpenDialog(NULL);
> OpenDialog->InitialDir = "ThePath";
> if(OpenDialog->Execute())
> {
>         // do stuff
> }
> delete OpenDialog;
>
> This way You have a new one every time.
>
> Kind regards
> Asger
Re: OpenDialogBox and Inital Dir
#851
Author: Remy Lebeau (TeamB)
Date: Fri, 07 Dec 2007 18:04
11 lines
1360 bytes
"Christophe MINETTI" <cminetti@ulb.ac.be> wrote in message 
news:4759646C.A4CA4D26@ulb.ac.be...

> I use InitialDir which works fine the first time but then if I change
> the InitalDir value with another path, it does not take it into account.

You need to clear the FileName property before calling Execute() again.


Gambit 
Re: OpenDialogBox and Inital Dir
#852
Author: Wookie
Date: Fri, 07 Dec 2007 18:24
17 lines
1352 bytes
Thanks Gambit; it is exactly the solution I was expecting.

Best regards

Christophe

"Remy Lebeau (TeamB)" wrote:

> "Christophe MINETTI" <cminetti@ulb.ac.be> wrote in message
> news:4759646C.A4CA4D26@ulb.ac.be...
>
> > I use InitialDir which works fine the first time but then if I change
> > the InitalDir value with another path, it does not take it into account.
>
> You need to clear the FileName property before calling Execute() again.
>
> Gambit
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads