Transparent window: set Opacity : Irregularly Shaped Forms « GUI Windows Form « C# / C Sharp

Home
C# / C Sharp
1.2D Graphics
2.Class Interface
3.Collections Data Structure
4.Components
5.Data Types
6.Database ADO.net
7.Design Patterns
8.Development Class
9.Event
10.File Stream
11.Generics
12.GUI Windows Form
13.Language Basics
14.LINQ
15.Network
16.Office
17.Reflection
18.Regular Expressions
19.Security
20.Services Event
21.Thread
22.Web Services
23.Windows
24.Windows Presentation Foundation
25.XML
26.XML LINQ
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source
C# / C Sharp » GUI Windows Form » Irregularly Shaped FormsScreenshots 
Transparent window: set Opacity

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

public class Form1 : Form
{
  private System.Windows.Forms.GroupBox GroupBox1;
  private System.Windows.Forms.Button cmdApply;
  private System.Windows.Forms.NumericUpDown udOpacity;
  private System.Windows.Forms.Label Label1;

  public Form1() {
        InitializeComponent();
  }


  private void cmdApply_Click(object sender, EventArgs e)
  {
    this.Opacity = (double)udOpacity.Value / 100;
  }
  private void InitializeComponent()
  {
    this.GroupBox1 = new System.Windows.Forms.GroupBox();
    this.cmdApply = new System.Windows.Forms.Button();
    this.udOpacity = new System.Windows.Forms.NumericUpDown();
    this.Label1 = new System.Windows.Forms.Label();
    this.GroupBox1.SuspendLayout();
    ((System.ComponentModel.ISupportInitialize)(this.udOpacity)).BeginInit();
    this.SuspendLayout();
    // 
    // GroupBox1
    // 
    this.GroupBox1.Controls.Add(this.cmdApply);
    this.GroupBox1.Controls.Add(this.udOpacity);
    this.GroupBox1.Controls.Add(this.Label1);
    this.GroupBox1.Location = new System.Drawing.Point(1289);
    this.GroupBox1.Name = "GroupBox1";
    this.GroupBox1.Size = new System.Drawing.Size(268116);
    this.GroupBox1.TabIndex = 5;
    this.GroupBox1.TabStop = false;
    // 
    // cmdApply
    // 
    this.cmdApply.Location = new System.Drawing.Point(17264);
    this.cmdApply.Name = "cmdApply";
    this.cmdApply.Size = new System.Drawing.Size(8024);
    this.cmdApply.TabIndex = 5;
    this.cmdApply.Text = "Apply";
    this.cmdApply.Click += new System.EventHandler(this.cmdApply_Click);
    // 
    // udOpacity
    // 
    this.udOpacity.Increment = new decimal(new int[] {
        5,
        0,
        0,
        0});
    this.udOpacity.Location = new System.Drawing.Point(8832);
    this.udOpacity.Name = "udOpacity";
    this.udOpacity.Size = new System.Drawing.Size(4821);
    this.udOpacity.TabIndex = 4;
    this.udOpacity.Value = new decimal(new int[] {
        50,
        0,
        0,
        0});
    // 
    // Label1
    // 
    this.Label1.Location = new System.Drawing.Point(2036);
    this.Label1.Name = "Label1";
    this.Label1.Size = new System.Drawing.Size(5616);
    this.Label1.TabIndex = 3;
    this.Label1.Text = "Opacity:";
    // 
    // Transparent
    // 
    this.AutoScaleDimensions = new System.Drawing.SizeF(6F13F);
    this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    this.ClientSize = new System.Drawing.Size(309289);
    this.Controls.Add(this.GroupBox1);
    this.Font = new System.Drawing.Font("Tahoma"8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
    this.Name = "Transparent";
    this.Text = "Transparent";
    this.GroupBox1.ResumeLayout(false);
    ((System.ComponentModel.ISupportInitialize)(this.udOpacity)).EndInit();
    this.ResumeLayout(false);

  }


  [STAThread]
  static void Main()
  {
    Application.EnableVisualStyles();
    Application.Run(new Form1());
  }

}



           
       
Related examples in the same category
1.Transparent window: holes
2.Transparent form windowTransparent form window
3.Non rectangle Form windowNon rectangle Form window
4.Transparent window and screen captureTransparent window and screen capture
5.Irregularly Shaped Forms demo 1Irregularly Shaped Forms demo 1
6.Irregularly Shaped Forms DemoIrregularly Shaped Forms Demo
7.Transparent FormsTransparent Forms
8.Transparent Forms: holesTransparent Forms: holes
9.Transparent formTransparent form
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.