Looking for a specific control

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • djidan
    New Member
    • Oct 2008
    • 9

    Looking for a specific control

    hi,

    I am a c# student and we just started to learn about winform's.

    we learned about open and save filedialog() recently,

    I want to make my own openfiledialog, but i searched every where for this control and i could not find thing that was helpfull, i uploaded a picture with the control that i am looking for to rapidshare, if someone can help me it will be great.



    thank's
    idan
  • cloud255
    Recognized Expert Contributor
    • Jun 2008
    • 427

    #2
    Hi

    If you just want to create an instance of the open/save file dialog control you just do the following:

    OpenFileDialog openFileDialog1 = new OpenFileDialog( );

    Or

    SaveFileDialog saveFileDialog1 = new SaveFileDialog( );

    Please use more descriptive names than these.

    To create your own one, i suggest you look into inheriting from one of its parent controls such as the CommonDialog, it will require a bit of playing around to see just what to inherit from (judging from you are currently learning, i doubt that you will be using inheritance)

    good luck

    Comment

    • tlhintoq
      Recognized Expert Specialist
      • Mar 2008
      • 3532

      #3
      Originally posted by djidan
      hi,

      I am a c# student and we just started to learn about winform's.

      we learned about open and save filedialog() recently,

      I want to make my own openfiledialog, but i searched every where for this control and i could not find thing that was helpfull, i uploaded a picture with the control that i am looking for to rapidshare, if someone can help me it will be great.



      thank's
      idan
      Are you looking for a control that is *just* the file listing box, as outlined in red on your uploaded graphic?

      Do you think the file list box is something already built and part of Visual Studio, that you could just drop on to your form, like you would a TextBox or a RadioButton?

      Comment

      • djidan
        New Member
        • Oct 2008
        • 9

        #4
        hi

        thank's for the quick reply.

        cloud255: we learned already inheritance and i know how to do it,
        but when i looked on msdn about openfiledialog class property it's saying that it's a seald class, and it's "father" filedialog class, it's not seald but there is a private method's that you need to override but you can't because they are in private, about inherite from commondialog it's not usefull because i don't want to make a all new windows i just want to use the control i have posted.

        tlhintoq: yes, fix me if i am wrong, i assumed that it's a control that you can just drag and drop from the toolkit, if not> how can i do it?
        beause when i searched the web the only thing's i found that are almost what i need are: "DirListBox","D riveListBox", "FileListBo x", and that's not what i want, i want exactly what i uploaded on rapidshare.

        thanks

        idan

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          You could create your own with a TreeView and using System.IO.Direc tory (and .File) probably?

          Comment

          • joedeene
            Contributor
            • Jul 2008
            • 579

            #6
            Originally posted by djidan
            ...i want exactly what i uploaded on rapidshare.

            thanks

            idan
            If you want EXACTLY what you have uploaded on the rapidshare site, then why not use the OpenFileDialog? You'd spend forever trying to create graphics for the personal dialog that you make, that compare to Vista's. Are you not allowed to use this control? Do you HAVE to create your own dialog?

            joedeene

            Comment

            • tlhintoq
              Recognized Expert Specialist
              • Mar 2008
              • 3532

              #7
              Originally posted by djidan
              hi

              thank's for the quick reply.

              cloud255: we learned already inheritance and i know how to do it,
              but when i looked on msdn about openfiledialog class property it's saying that it's a seald class, and it's "father" filedialog class, it's not seald but there is a private method's that you need to override but you can't because they are in private, about inherite from commondialog it's not usefull because i don't want to make a all new windows i just want to use the control i have posted.

              tlhintoq: yes, fix me if i am wrong, i assumed that it's a control that you can just drag and drop from the toolkit, if not> how can i do it?
              beause when i searched the web the only thing's i found that are almost what i need are: "DirListBox","D riveListBox", "FileListBo x", and that's not what i want, i want exactly what i uploaded on rapidshare.

              thanks

              idan
              Idan. Nope. Sorry to break that bad news to you. But that area you outlined in red is not a control you can D-n-D onto a form.

              But as Plater suggests you could build one.
              • Open your project.
              • In Solution Explorer, right-click on your Project
              • From the context menu choose "Add..."
              • from the submenu choose "User Control"


              Then start adding methods, properties and events to create a control that does everything you want.

              Plater Today 06:43 AM
              Moderator - 5,750 Posts
              #5: Re: Looking for a specific control

              You could create your own with a TreeView and using System.IO.Direc tory (and .File) probably?
              The beauty of such things is that once you have created these custom controls you can use them over and over just like any other tool in the toolbox pallet.

              A search on Google for "C# user controls" will get you lots of good results and how-to tutorials such as this one .

              Comment

              Working...