Form.Opacity : Form « System.Windows.Forms « C# / C Sharp by API






Form.Opacity

   

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

public class FormOpacitySetting : System.Windows.Forms.Form
{
  private System.ComponentModel.Container components = null;

  public FormOpacitySetting()
  {
    InitializeComponent();
    Opacity = 0.5d;
    this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint);
  }

  protected override void Dispose( bool disposing )
  {
    if( disposing )
    {
      if (components != null) 
      {
        components.Dispose();
      }
    }
    base.Dispose( disposing );
  }

  private void InitializeComponent()
  {
    this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
    this.ClientSize = new System.Drawing.Size(292, 273);
    this.Text = "Form1";
  }
  [STAThread]
  static void Main() 
  {
    Application.Run(new FormOpacitySetting());
  }

  private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
  {
    Graphics g = e.Graphics;
    g.DrawString("String...", new Font("Times New Roman", 20), new SolidBrush(Color.Black), 40, 10);
  }
}

   
    
    
  








Related examples in the same category

1.new Form()
2.extends Form
3.Form.AcceptButton
4.Form.ActiveForm.Location
5.Form.Activated
6.Form.AddOwnedForm
7.Form.AutoScaleBaseSize
8.Form.AutoScroll
9.Form.AutoScrollMinSize
10.Form.BackColor
11.Form.CancelButton
12.Form.CenterToScreen()
13.Form.ClientRectangle
14.Form.ClientSize
15.Form.Closed
16.Form.Closing
17.Form.ContextMenu
18.Form.ControlBox
19.Form.Controls
20.Form.Cursor
21.Form.DesktopBounds
22.Form.DialogResult
23.Form.DisplayRectangle
24.Form.Dispose
25.Form.FormBorderStyle
26.Form.ForeColor
27.Form.GotFocus
28.Form.Height
29.Form.Hide()
30.Form.Invalidate
31.Form.IsMdiContainer
32.Form.KeyPress
33.Form.KeyPreview
34.Form.KeyUp
35.Form.Load
36.Form.Location
37.Form.MaximizeBox
38.Form.MaximumSize
39.Form.MdiParent
40.Form.MenuComplete
41.Form.Menu
42.Form.MinimizeBox
43.Form.MinimumSize
44.Form.MouseDown
45.Form.MouseLeave(All other events)
46.Form.MouseUp
47.Form.OnDragDrop
48.Form.OnDragOver
49.Form.OnInputLanguageChanged
50.Form.OnKeyDown
51.Form.OnKeyPress
52.Form.OnMouseEnter
53.Form.OnMouseHover
54.Form.OnMouseLeave
55.Form.OnMouseMove
56.Form.OnMouseWheel
57.Form.OnPaint(PaintEventArgs e)
58.Form.OnResize
59.Form.Paint
60.Form.Region
61.Form.Resize
62.Form.ResizeRedraw
63.Form.SetStyle
64.Form.ShowInTaskbar
65.Form.Size
66.Form.Show
67.Form.StartPosition
68.Form.SuspendLayout
69.Form.Text
70.Form.Top
71.Form.TransparencyKey
72.Form.Visible
73.Form.Width
74.Form.WindowState