none
Derive a class from FileDialog RRS feed

  • Question

  • I am trying to derive a class from the FileDialog class but I am not able to do it.

    I get the the error as I need to to override RunFileDialog method

    Error 1 'GuiTest.GuiFileDialog' does not implement inherited abstract member 'System.Windows.Forms.FileDialog.RunFileDialog(System.Windows.Forms.NativeMethods.OPENFILENAME_I)'

    Now if I override the RunFileDialog I dont get the NativeMethods namespace

    So I thought of declaring the OpenFileName of my own but that also did not help and the parameter of RunFileDialog did not match.

    If anyone can give me some hints.

    Thanks
    Shabbir

    Wednesday, November 8, 2006 1:09 PM

Answers

  • Forget about derive from the FileDialog class. This class makes use of internal classes that aren't available from outside the assembly. That is the reason you can't derive from it!
    Wednesday, November 8, 2006 2:01 PM

All replies

  • Forget about derive from the FileDialog class. This class makes use of internal classes that aren't available from outside the assembly. That is the reason you can't derive from it!
    Wednesday, November 8, 2006 2:01 PM
  • Then how can I go about making the customization to the FileDialog. Something like A preview for the image and other stuff that we used to be doing in MFC.

    Thanks
    Shabbir

    Thursday, November 9, 2006 5:05 AM
  • I received the newsletter from Codeproject and saw an article about this topic. Meybe this is very interesting for you:

    http://www.codeproject.com/cs/miscctrl/OpenFileDialogEx.asp

    Thursday, November 23, 2006 3:16 PM
  • The problem is already solved but thanks for the link.
    Tuesday, December 5, 2006 6:25 AM
  • Hi,

         I am falling in the same problem. Can you please tell the solution as well. It would be very good.

    Thanks

    Mayank

    Monday, May 5, 2008 3:53 PM
  • Mayank007:

     

    This thread has already been answered.  See the post marked "Answer".  You cannot derive from these types.

     

    Monday, May 5, 2008 3:57 PM
    Moderator
  •  

    But Shabbir bhimani has solved the problem. I want to know that what alternate or solution he/she has used.

     

    Mayank

    Monday, May 5, 2008 4:06 PM
  • Used the API to display the dialog instead of .NET Control.

    --
    Programming and web development forum - www.go4expert.com
    Wednesday, May 7, 2008 12:44 PM