 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Andrew Smith Guest
|
Posted: Fri Feb 17, 2006 4:03 am Post subject: TOpenDialog and initial dir |
|
|
Hi guys,
Got a TOpenDialog and am programatically setting the initial directory:
void __fastcall TfrmConfig::dlgOpenShow(TObject *Sender)
{
String strDir = getenv("DIRPATH");
if (DirectoryExists(strDir))
{
dlgOpen->InitialDir = strDir;
}
}
InitialDir gets set, but once executed the dialog does not open in the
specified directory. This is driving me nuts, any suggestions?
Cheers,
Andrew |
|
| Back to top |
|
 |
JD Guest
|
Posted: Fri Feb 17, 2006 7:03 am Post subject: Re: TOpenDialog and initial dir |
|
|
"Andrew Smith" <nospamlaconical (AT) gmail (DOT) com> wrote:
| Quote: |
[...] InitialDir gets set, but once executed the dialog does
not open in the specified directory.
|
This has been discussed here many, many times in the past.
| Quote: | This is driving me nuts,
|
Have you searched the archives?
http://www.tamaracka.com/search.htm
Have a look at it's Options property and ofNoChangeDir.
~ JD |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Fri Feb 17, 2006 9:03 am Post subject: Re: TOpenDialog and initial dir |
|
|
"Andrew Smith" <nospamlaconical (AT) gmail (DOT) com> wrote in message
news:43f54263$2 (AT) newsgroups (DOT) borland.com...
| Quote: | Got a TOpenDialog and am programatically setting the initial directory:
|
You are setting it in the wrong place. Setting it in the dialog's OnShow
event hs no effect. You have to set it before you call Execute(), ie:
void __fastcall TfrmConfig::btnClick(TObject *Sender)
{
String strDir = getenv("DIRPATH");
if( DirectoryExists(strDir) )
dlgOpen->InitialDir = strDir;
else
dlgOpen->InitialDir = "";
if (dlgOpen->Execute())
{
//...
}
}
Gambit |
|
| Back to top |
|
 |
Andrew Smith Guest
|
Posted: Sun Feb 19, 2006 8:03 am Post subject: Re: TOpenDialog and initial dir |
|
|
Didn't even know that webiste existed, I'll have a look now, cheers
"JD" <nospam (AT) nospam (DOT) com> wrote in message
news:43f5635c$1 (AT) newsgroups (DOT) borland.com...
| Quote: |
"Andrew Smith" <nospamlaconical (AT) gmail (DOT) com> wrote:
[...] InitialDir gets set, but once executed the dialog does
not open in the specified directory.
This has been discussed here many, many times in the past.
This is driving me nuts,
Have you searched the archives?
http://www.tamaracka.com/search.htm
any suggestions?
Have a look at it's Options property and ofNoChangeDir.
~ JD
|
|
|
| Back to top |
|
 |
Andrew Smith Guest
|
Posted: Sun Feb 19, 2006 8:03 am Post subject: Re: TOpenDialog and initial dir |
|
|
Thanks Remy, that was certainly part of the problem
"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> wrote in message
news:43f586e5$1 (AT) newsgroups (DOT) borland.com...
| Quote: |
"Andrew Smith" <nospamlaconical (AT) gmail (DOT) com> wrote in message
news:43f54263$2 (AT) newsgroups (DOT) borland.com...
Got a TOpenDialog and am programatically setting the initial directory:
You are setting it in the wrong place. Setting it in the dialog's OnShow
event hs no effect. You have to set it before you call Execute(), ie:
void __fastcall TfrmConfig::btnClick(TObject *Sender)
{
String strDir = getenv("DIRPATH");
if( DirectoryExists(strDir) )
dlgOpen->InitialDir = strDir;
else
dlgOpen->InitialDir = "";
if (dlgOpen->Execute())
{
//...
}
}
Gambit
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|