Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Initial Dir in OpenDialog? 1

Status
Not open for further replies.

hstijnen

Programmer
Nov 13, 2002
172
NL
Hí,

When I set InitialDir in a OpenDialog, the first time it opens in the right dir. When I change the directory during the dialog, the next time the OpenDialog ignores the InitialDir and opens in the last selected directory.

How can I enforce the OpenDialog to open always in the given InitialDir?

Thanks in advance

Henk Stijnen
 
The folder is determined by the OpenDialog FileName property. If you initialize the FileName property back to NULL before calling the Execute method, it will revert back to the InitialDir.

like:
Code:
OpenDialog1->FileName = "";
OpenDialog1->Execute();

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top