Click here to Skip to main content
15,881,687 members
Articles / Desktop Programming / Windows Forms
Tip/Trick

Simplest way to implement irregular forms in .NET

Rate me:
Please Sign up or sign in to vote.
4.88/5 (37 votes)
24 Jan 2011CPOL 60.8K   43   19
Make irregular splash screens without writing a single line of code!
Irregular splash screens are quite common these days (e.g. Photoshop, etc.)
Do you want to make an irregular splash screen for your .NET application with minimal or no code at all? Here is the tip:

  1. Prepare the irregularly shaped image in GIF format with
    transparent background in your favorite image editor
  2. On your .NET WinForm, set this GIF image as the
    BackgroundImage property of the form. The image should appear on
    the form now
  3. Set the FormBorderStyle property as 'None'
  4. Set the BackgroundImageLayout property as 'None'
  5. Set the BackColor property to a color that is not in your
    picture (eg. Teal)
  6. Set the TransparencyKey property of form to the same color
  7. Run the application: You have made your irregular splash
    screen. Don't forget to set the StartPosition property to
    CenterScreen too



Hope this is a helpful tip. Forgive me if some of you already know this. In earlier days, I used to write a full class with drawing functions to achieve the same effect.

Nejimon CR
Software Developer
Kerala, India

You might also like to take a look at my article on CodeProject:
Serial Foot Pedal Device Server[^]

License

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


Written By
Architect
India India
Nejimon CR started coding in early 2000s with classic Visual Basic 6 and later moved to .NET platform. His primary technology stack expertise is around Microsoft technologies, but with the previous and latest areas of functioning to include a wide variety of technologies such as Win32 APIs, AutoIt scripting, UI Automation, ASP.NET MVC and Web API, Node.js, NoSQL, Linq, Entity Framework, AngularJS, etc.

His Articles on CodeProject:
http://www.codeproject.com/Articles/1060520/Centralizing-WCF-Client-Configuration-in-a-Class-L
http://www.codeproject.com/Articles/567356/Asynchronous-Access-of-Web-Service-from-WPF-with-B
http://www.codeproject.com/Articles/63849/Serial-Foot-Pedal-Device-Server
http://www.codeproject.com/Tips/149249/Simplest-way-to-implement-irregular-forms-in-NET
http://www.codeproject.com/Tips/564388/Entity-Framework-Code-First-Navigation-Property-is

Comments and Discussions

 
GeneralReason for my vote of 5 My vote of 5 A very simple and elega... Pin
chathuranga abeyrathne19-Oct-11 6:55
chathuranga abeyrathne19-Oct-11 6:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.