Skip to main content

Hot to set FolderBrowserDialog RootFolder in Visual COBOL

  • October 4, 2019
  • 1 reply
  • 1 view

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.

1 reply

  • October 4, 2019

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.

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.