public partial class Form7 : Form
{
public Form7()
{
InitializeComponent();
}
private void button1_SizeChanged(object sender, EventArgs e)
{
Font font = new Font(button1.Font.FontFamily,button1.Height * 0.5f);
button1.Font = font;
}
}
partial class Form7
{
///
/// Required designer variable.
///
private System.ComponentModel.IContainer components = null;
///
/// Clean up any resources being used.
///
///
true if managed resources should be disposed; otherwise, false.
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.button1.Location = new System.Drawing.Point(61, 61);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(192, 48);
this.button1.TabIndex = 0;
this.button1.Text = "按钮";
this.button1.UseVisualStyleBackColor = true;
this.button1.SizeChanged += new System.EventHandler(this.button1_SizeChanged);
//
// Form7
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 186);
this.Controls.Add(this.button1);
this.Name = "Form7";
this.Text = "Form7";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button button1;
阅读(367) | 评论(0) | 转发(0) |