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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FolderBrowserDialog.InitialDirectory property is not shown

Status
Not open for further replies.

IlyaRabyy

Programmer
Nov 9, 2010
566
0
16
US
Colleagues,
I use the Dialog in subject to let the User select an output dir for files. I want the initial dir shown in this dialog to be a certain one. Here's the article in the MS VS Help:
"FolderBrowserDialog.InitialDirectory Property

Namespace: System.Windows.Forms

Assembly: System.Windows.Forms.dll

Gets or sets the initial directory displayed by the folder browser dialog.
C#

public string InitialDirectory { get; set; }

Property Value String

Applies to
Product Versions
Windows Desktop 6, 7 RC 1
"
(
However, when I start typing the dialog's name an put in a dot, the InitialDirectory property isn't shown!

2022_10_24_14_30_FolderBrowserDialog_InitialDirectory_PropertyNotShown_o0abit.jpg


As you can see, there's only one "Initial" property shown in the drop-down "cheat-sheet", and it's not InitialDirectory!
What am I missing?
Please advise!
TIA!

Regards,

Ilya
 
IlyaRabyy said:
Applies to
Product Versions
Windows Desktop 6, 7 RC 1

The above is your problem. You are quoting documentation for Windows Desktop 6, which requires .Net 6. And technically .NET 6 is not compatible with VS19 (which I believe is what you are using)
 
Colleagues,
The problem was resolved by assigning the Dialog's SelectedPath property before firing ShowDialog method.


Regards,

Ilya
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top