Highlighted
Phil_L
Visitor.
85 views

Hot to set FolderBrowserDialog RootFolder in Visual COBOL

Jump to solution

I'm trying to convert this C# code to Visual COBOL:

folderBrowserDialog1.RootFolder = Environment.SpecialFolder.MyComputer

When I try to do this in Visual COBOL, the SpecialFolder enumeration is not found.

I'm using Visual COBOL verion 2.3.

Phil Levin

0 Likes
1 Solution

Accepted Solutions
Phil_L
Visitor.

Re: Hot to set FolderBrowserDialog RootFolder in Visual COBOL

Jump to solution

I figured out the syntax for this:

set folderBrowserDialog1::RootFolder to  type System.Environment+SpecialFolder::MyComputer

If I then include this line of code:

set folderBrowserDialog1::SelectedPath to myStartingFolder (a string set to a directory path)

FolderBrowserDialog takes me to that folder.

Phil Levin

0 Likes
1 Reply
Phil_L
Visitor.

Re: Hot to set FolderBrowserDialog RootFolder in Visual COBOL

Jump to solution

I figured out the syntax for this:

set folderBrowserDialog1::RootFolder to  type System.Environment+SpecialFolder::MyComputer

If I then include this line of code:

set folderBrowserDialog1::SelectedPath to myStartingFolder (a string set to a directory path)

FolderBrowserDialog takes me to that folder.

Phil Levin

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.