Click here to Skip to main content
13,091,537 members (64,739 online)
Click here to Skip to main content
Add your own
alternative version


47 bookmarked
Posted 11 Mar 2002

A Shaped Windows Form Application with Variable Opacity

, 20 Sep 2007
Rate this:
Please Sign up or sign in to vote.
How to create a Shaped Windows Application with Variable Opacity


This application demonstrates two simple techniques that beginners might find useful in developing creative new looks for Windows applications.

The first technique is that of a shaped Windows form and is an implementation of a Microsoft article.

The second technique is also from Microsoft. I saw it in a Webcast entitled "Debugging .NET Applications with Visual Studio® .NET" by Shaykat Chaudhuri. He demonstrated a transparent Windows Forms timer application. Using this application, he showed how he was able to time his presentations for proper length while viewing through the transparent timer at his Power Point cells. I was impressed. I don't know if the source code is available for this demo, but it turns out this technique very simple to achieve in Visual Studio .NET.

I've combined these two simple concepts in the attached demo. The demo is written in C# and Windows Forms and was tested in Windows 2000 using VS Ver. 7.0.9466 and the .NET Framework Ver. 1.0.3705.

Shown below is a clock application running on the desktop in its transparent mode. The application can be dragged and positioned with the left mouse button while transparent.

The right mouse button brings up a context menu with various settings and an exit item (providing basic title bar functionality). It also brings up the opacity factor in steps as the application "un-cloaks" for use. When a menu item is selected, the application "fades-out" back to the transparent mode (or terminates).

The application included (winShapeSevenSegmentLED.exe) uses the seven-segment "retro" digital clock in Charles Petzold's book "Programming Microsoft Windows with C#" ISBN: 0-7356-1370-2. I didn't include the source code as it is copyrighted, but if you have the book you can uncomment the #define, add his SevenSegmentClock class to the project, and recreate the application shown above. Without this code, only the basic shaped form, menu items and opacity functionality are provided.

Using uncommonly shaped and transparent objects might make an interesting desktop for a child. She would be able to see all running applications at once and in fun, compelling shapes and colors.


  • March 12, 2002 — article posted
  • September 20, 2007 — Matthias Döringer provides bugfix


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Robert Hinrichs
United States United States
No Biography provided

You may also be interested in...


Comments and Discussions

GeneralMatthias Döringer provides bugfix Pin
Sean Ewington20-Sep-07 4:56
adminSean Ewington20-Sep-07 4:56 
GeneralWhy Won't It Work Pin
nhambayi31-Aug-04 9:38
membernhambayi31-Aug-04 9:38 
GeneralRe: Why Won't It Work Pin
glocke14-Oct-04 1:47
memberglocke14-Oct-04 1:47 
GeneralRe: Why Won't It Work Pin
RipplingCreek3-Oct-05 10:56
memberRipplingCreek3-Oct-05 10:56 
GeneralDriver Issues Pin
R. Hinrichs15-Mar-02 3:12
memberR. Hinrichs15-Mar-02 3:12 
GeneralRe: Driver Issues Pin
ori_yq30-Dec-02 9:24
memberori_yq30-Dec-02 9:24 
GeneralRe: Driver Issues Pin
Robert Hinrichs30-Jan-03 2:42
memberRobert Hinrichs30-Jan-03 2:42 

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.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170813.1 | Last Updated 20 Sep 2007
Article Copyright 2002 by Robert Hinrichs
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid