1
复选框文字在左边,最下边为水平滚动条,拖动滚动条文字大小随之变化,点击复选框,单选按钮,文字随之变化。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Wi
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
hScrollBar1.Maximum = 72;
hScrollBar1.Minimum = 4;
label2.Font = new Font("宋体",20,FontStyle.Regular);
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
label2.Font = new Font(label2.Font.Name,label2.Font.Size,
checkBox1.Checked?label2.Font.Style|FontStyle.Italic:label2.Font.Style^(FontStyle.Italic));
}