Rationale: Rewrite the current form OnPaint method as follows:
protected override void OnPaint(PaintEventArgs e)
{
e.Graphics.DrawImage((Image)bit, new Point(0, 0));
}
A. Form design:
Code generated #region the Windows forms Designer
///<summary>
///Designer supports the desired method-do not
///use the Code Editor to modify the contents of this method.
///</summary>
private void InitializeComponent ()
{
This.label1 = new System.Windows.Forms.Label ( );
this. SuspendLayout ();
//
//Label1
//
This.label1.BackColor = System.Drawing.Color.Transparent;
This.label1.Location = New System.Drawing.Point (261, 56);
This.label1.Name = "Label1";
This.label1.Size = new System.Drawing.Size (17, 16);
This.label1.TabIndex = 0;
This.label1.Click + = new System.EventHandler (This.label1_click);
//
//Form1
//
this. Autoscaledimensions = new System.Drawing.SizeF (6F, 12F);
this. AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this. BackColor = System.Drawing.SystemColors.Control;
this. ClientSize = new System.Drawing.Size (393, 317);
this. Controls.Add (THIS.LABEL1);
this. FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this. Name = "Form1";
this. StartPosition = SystEm. Windows.Forms.FormStartPosition.CenterScreen;
this. Text = "Non-rectangular form";
this. TransparencyKey = System.Drawing.SystemColors.Control;
this. Load + = new System.EventHandler (this. Form1_Load);
this. ResumeLayout (FALSE);
}
#endregion