How to Create Custom Forms in .NET ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ganesh9u
    New Member
    • Oct 2008
    • 23

    How to Create Custom Forms in .NET ?

    Custom Form in C#

    Eg. I want my C# application Form which should look like mac or any other skin.

    My window should look like this..
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    You can set the background image of your forms to be an image of your choosing. Set the Transparent color to a color you want to see through, and remove the formborder and other things (remember to provide a way to close the form)

    Comment

    • Curtis Rutland
      Recognized Expert Specialist
      • Apr 2008
      • 3264

      #3
      I googled the first line of your question:
      "Custom Form in C#"
      and the very first link took me to a tutorial on exactly how to customize a form.

      And I've asked you before to research these kinds of questions before posting them.

      When you consider that it takes hours to post, wait, let us respond, wait, tell us we misunderstood, wait....and it takes minutes to use google......you must see my point.

      Comment

      • Ganesh9u
        New Member
        • Oct 2008
        • 23

        #4
        Yes insertAlias I agree with you, but I also searched a lot, I got a the transparency but not exactly the same, So you understand that i am not started this post for fun, this is my serious question anyway thanks for your post.

        Comment

        • Ganesh9u
          New Member
          • Oct 2008
          • 23

          #5
          Originally posted by Plater
          You can set the background image of your forms to be an image of your choosing. Set the Transparent color to a color you want to see through, and remove the formborder and other things (remember to provide a way to close the form)
          Thanks for your post.

          I have done those things.

          1.this.FormBord erStyle = FormBorderStyle .None;

          2.this.Transpar encyKey = System.Drawing. Color.FromArgb( ((System.Byte)( 255)), ((System.Byte)( 128)), ((System.Byte)( 128)));

          3. this.pictureBox 1.BackColor = System.Drawing. Color.FromArgb( ((int)(((byte)( 255)))), ((int)(((byte)( 128)))), ((int)(((byte)( 128)))));

          4.this.pictureB ox1.BackgroundI mageLayout = System.Windows. Forms.ImageLayo ut.None;

          5. this.pictureBox 1.ImageLocation = "some window image.gif";

          but the problem is that the window is not in round rect as I attached the image above. I gives an artificial look. but in .net 2003 it looks good i am using 2005

          do you have any idea.

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            Set your image as the background image on the form, not on a picturebox control

            Comment

            • Ganesh9u
              New Member
              • Oct 2008
              • 23

              #7
              Originally posted by Plater
              Set your image as the background image on the form, not on a picturebox control
              I have done that too. but the border is not in round rect it lookes like eg.
              My Custom From
              I have created like this



              but i want round rect do you have idea..

              Comment

              • Plater
                Recognized Expert Expert
                • Apr 2007
                • 7872

                #8
                I am confused.
                If you created your form from an image, it will be whatever shape you have in the image.
                So change your image to be a round rectangle and shadow it?

                Comment

                • Ganesh9u
                  New Member
                  • Oct 2008
                  • 23

                  #9
                  Originally posted by Plater
                  I am confused.
                  If you created your form from an image, it will be whatever shape you have in the image.
                  So change your image to be a round rectangle and shadow it?
                  I also placed the round rect image but at the border I got no transparency.

                  Comment

                  • Plater
                    Recognized Expert Expert
                    • Apr 2007
                    • 7872

                    #10
                    The FormBorderStyle is set to none? The image is the background image of the form itself, and not some control on the form?

                    EDIT: Hmm I just did it, and no, it no longer seems to work. Even when using the examples from other websites. Interesting, it used to.
                    Even pre-built .EXEs for it. I am going to blame the .net3.0/3.5 framework and its newer version of winforms

                    More EDIT: This example proves that it can still be done with a custom drawing path http://vckicks.110mb.com/custom_shape_form_region.html

                    Comment

                    • Ganesh9u
                      New Member
                      • Oct 2008
                      • 23

                      #11
                      Originally posted by Plater
                      The FormBorderStyle is set to none? The image is the background image of the form itself, and not some control on the form?
                      Yes FormBoderStyle set to none and the image is the background image of the form itself.

                      Comment

                      • Ganesh9u
                        New Member
                        • Oct 2008
                        • 23

                        #12
                        Hi, All thanks for your help I got it.

                        Comment

                        Working...