caesay
caesay

Reputation: 17213

Advanced transparency in a form

Im looking for a way to create form(s) similar in style to the following two..

Ive played with transparency keys, the windows API, but have not successfully done this in Windows Forms.

[broken image]

what im looking for with this post is any references to articles explaining how this can be done, or some code examples. -- but i will accept any kind of input.

I would use Windows Vista/7 Areo glass if it didnt have such horrible alpha-blending issues.

Upvotes: 0

Views: 1296

Answers (3)

Robert Levy
Robert Levy

Reputation: 29073

Refer to the link below for an article about how to find a way to show Windows standard controls on layered windows. It provides both Native MFC and WinForms source code.

Cool, Semi-transparent and Shaped Dialogs with Standard Controls for Windows 2000 and Above

Using the Code in WinForms/.NET

First Step:

Copy files in the /Src/. directory to your project.

Second Step

You need an image file to be the dialog background. You'd better choose PNG or TIFF which support alpha channel.

Final Step

Replace the dialog base class from Form to ImageDlgBase.

public partial class Form2 : CoolImageDlg.ImageDlgBase {
    public Form2()
    {
        base.DlgBgImg = ImgDlgSample.Properties.Resources.DemoDlgBg2;
        //......
     } 
}

See the example code in the article.

Upvotes: 0

SwDevMan81
SwDevMan81

Reputation: 49978

I think you want to adjust the Opacity of the Form.

See this example

Upvotes: 3

user180326
user180326

Reputation:

You can tell the DWM to extend the "glass" area of your window. See Figure 10 in this article

Or, by using DirectX, you can get this effect. Don't think you can with winforms, though.

Upvotes: 0

Related Questions