Click here to Skip to main content
15,886,045 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi is it possible to change the default icon of a OpenFileDialog in code?

This is the code that I have written at the moment, but there isn't a property value for the icon. Is this a limitation or is there a workaround without having to create a control myself.

C#
public static FileInfo GetFilePath(string FilterType, string Title, string IntDir)
{
   FileInfo ReturnValue = null;
   using (OpenFileDialog GetFileDialog = new OpenFileDialog())
   {
      GetFileDialog.Filter = FilterType;
      GetFileDialog.InitialDirectory = IntDir;
      GetFileDialog.Title = Title;

      if (GetFileDialog.ShowDialog() == DialogResult.OK)
      {
         ReturnValue = new FileInfo(GetFileDialog.FileName);
      }
   }
   return ReturnValue;
}


Thanks
Posted
Updated 13-May-14 0:35am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900