when i click on the button to select a folder using folderBrowserDialog in c# the dialog is not shown and the result of dialog is set to Cancel automatically ..here is the code behind Button_Click :
private void glassButton1_Click(object sender, EventArgs e)
{
DialogResult result = folderBrowserDialog1.ShowDialog();//here Dialog is not shown and result=Cancel
if (result==DialogResult.OK)
{
folderBrowserDialog1.ShowNewFolderButton = true;
backupPath = folderBrowserDialog1.SelectedPath.ToString();
if (Directory.Exists(backupPath))
backupTextBox.Text = backupPath;
//else MessageBox.Show("path is invalid", "error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
}
}
how can i fix it ? thanks .