您的位置:首页 > 大数据 > 人工智能

DomainUpDown和NumericUpDown控件使用

2013-07-23 22:39 387 查看
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DomainUpDown和NumericUpDown控件使用
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
this.domainUpDownFont.SelectedIndex = 0;
}

private void domainUpDownFont_SelectedItemChanged(object sender, EventArgs e)
{
DomainUpDown dud = (DomainUpDown)sender;
float fontSize = this.label1.Font.Size;
Font newFont = new Font(dud.Text, fontSize);
this.label1.Font = newFont;
}

private void numericUpDown_ValueChanged(object sender, EventArgs e)
{
int r = (int)this.numericUpDownRed.Value;
int g = (int)this.numericUpDownGreen.Value;
int b = (int)this.numericUpDownBlue.Value;
this.label1.ForeColor = Color.FromArgb(r, g, b);
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: