/*
*程序的版权和版本声明部分:
*程序的版权和版本声明部分:
*Copyright(c)2013,烟台大学计算机学院学生
*All rights reserved.
*文件名称:
*作者:尚振伟
*完成日期:2014年11月11日
*版本号:v0.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 WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
ColorDialog colorDialog = new ColorDialog();
colorDialog.AllowFullOpen = true;
colorDialog.FullOpen = true;
colorDialog.ShowHelp = true;
colorDialog.Color = Color.Black; //获取或设置用户所选定的颜色
colorDialog.ShowDialog();
this.BackColor= colorDialog.Color; //使背景颜色显示所选定的颜色
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
结果展示:
心得体会:背景颜色的设置费力老大劲。。。