C # Special type form making: Making Glyph forms

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.