Custom Shaped Windows Forms in .NET


Introduction:

Now a days when we download several software’s from websites you will see a nicely custom shaped designed. Many developers who see this want implement it into their own applications. In this article I will demonstrate you how to achieve this in your application.

Steps to follow:

           1.  Create a bit map image in the paint with different shapes. For example


Note: Choose a background color, such as black which is easy to remember as this will be important later on.
     2.      Create a windows application project in the visual studio.
  1. Set the FormBorderStyle property to None.
  2. Set the BackgroundImage property of the form to the .bmp you created above.
  3. Set the TransparencyKey property of the form to the background color of the .bmp file. In the case of the example above, you would set it to black. This will make the black portion of the form disappear.
  4. Now run your application to see the effect.

Example: - custom form created in order to demonstrate you

Now run the application to see the effect of the style




Comments