using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace WindowsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
ColorDialog MyDialog = new ColorDialog();
// Keeps the user from selecting a custom color.
MyDialog.AllowFullOpen = false;
// Allows the user to get help. (The default is false.)
MyDialog.ShowHelp = true;
// Sets the initial color select to the current text color.
MyDialog.Color = ???这里我想获取表单FORM1的背景颜色 // Update the text box color if the user clicks OK
if (MyDialog.ShowDialog() == DialogResult.OK)
这里我想设置表单FORM1的背景颜色 = MyDialog.Color; }
}
}不知道该怎么写?书本上好像也找不到。不知道怎么办。谢谢啦。
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace WindowsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
ColorDialog MyDialog = new ColorDialog();
// Keeps the user from selecting a custom color.
MyDialog.AllowFullOpen = false;
// Allows the user to get help. (The default is false.)
MyDialog.ShowHelp = true;
// Sets the initial color select to the current text color.
MyDialog.Color = ???这里我想获取表单FORM1的背景颜色 // Update the text box color if the user clicks OK
if (MyDialog.ShowDialog() == DialogResult.OK)
这里我想设置表单FORM1的背景颜色 = MyDialog.Color; }
}
}不知道该怎么写?书本上好像也找不到。不知道怎么办。谢谢啦。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货