本文整理汇总了C#中System.Drawing.ToolboxBitmapAttribute类的典型用法代码示例。如果您正苦于以下问题:C# ToolboxBitmapAttribute类的具体用法?C# ToolboxBitmapAttribute怎么用?C# ToolboxBitmapAttribute使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ToolboxBitmapAttribute类属于System.Drawing命名空间,在下文中一共展示了ToolboxBitmapAttribute类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StopSignControl
[System.Drawing.ToolboxBitmap("c:\\stop.bmp")]
public class StopSignControl:
System.Windows.Forms.UserControl
{
internal System.Windows.Forms.Label Label1;
internal System.Windows.Forms.Button Button1;
public StopSignControl() : base()
{
this.Label1 = new System.Windows.Forms.Label();
this.Button1 = new System.Windows.Forms.Button();
this.Label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.0F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) 0));
this.Label1.ForeColor = System.Drawing.Color.Red;
this.Label1.Location = new System.Drawing.Point(24, 56);
this.Label1.Name = "Label1";
this.Label1.TabIndex = 0;
this.Label1.Text = "Stop!";
this.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.Button1.Enabled = false;
this.Button1.Location = new System.Drawing.Point(56, 88);
this.Button1.Name = "Button1";
this.Button1.Size = new System.Drawing.Size(40, 32);
this.Button1.TabIndex = 1;
this.Button1.Text = "stop";
this.Controls.Add(this.Button1);
this.Controls.Add(this.Label1);
this.Name = "StopSignControl";
}
private void StopSignControl_MouseEnter(object sender, System.EventArgs e)
{
Label1.Text.ToUpper();
Label1.Font = new System.Drawing.Font(Label1.Font.FontFamily, 14.0F,
System.Drawing.FontStyle.Bold);
Button1.Enabled = true;
}
private void StopSignControl_MouseLeave(object sender, System.EventArgs e)
{
Label1.Text.ToLower();
Label1.Font = new System.Drawing.Font(Label1.Font.FontFamily, 12.0F,
System.Drawing.FontStyle.Regular);
Button1.Enabled = false;
}
}