Abbas Hamza

Abbas Hamza

  • NA
  • 100
  • 53k

how can i open a folder directly using WPF FolderBrowserDial

Jul 18 2016 3:48 AM
Hi Guys,
I have create a folder on my C: drive that contain shortcuts to Microsoft office programs such as word, excel and Power point.
i have created a WPF application in that application i have created a button : what i wanted to achieve is to be able when clicked on that button I only wanted to open the folder directly to show the shortcuts.
Is the above achievable ?
I have tried the following but not what i want
 
  1. public static void OpenFolder()  
  2.        {  
  3.            FolderBrowserDialog openFol = new FolderBrowserDialog();  
  4.            openFol.ShowNewFolderButton = false;  
  5.            DialogResult result = openFol.ShowDialog();  
  6.            if (result == DialogResult.OK)  
  7.            {  
  8.                openFol.SelectedPath = @"C:\Users\XXX\Desktop\wpf";  
  9.                string foldername = openFol.SelectedPath;  
  10.            }  
  11.                       
  12.        }  
 
 
 

Answers (1)