颜色对话框使用
2010-08-21 17:41
225 查看
private void button1_Click(object sender, EventArgs e)
{
ColorDialog MyDialog = new ColorDialog();
// Keeps the user from selecting a custom color.
MyDialog.AllowFullOpen = true ;
// 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 = textBox1.ForeColor ;
// Update the text box color if the user clicks OK
if (MyDialog.ShowDialog() == DialogResult.OK)
{
textBox1.BackColor = MyDialog.Color;
}
}
{
ColorDialog MyDialog = new ColorDialog();
// Keeps the user from selecting a custom color.
MyDialog.AllowFullOpen = true ;
// 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 = textBox1.ForeColor ;
// Update the text box color if the user clicks OK
if (MyDialog.ShowDialog() == DialogResult.OK)
{
textBox1.BackColor = MyDialog.Color;
}
}
相关文章推荐
- GTK+ 消息对话框 属性对话框 字体选择对话框 颜色选择对话框 的使用例子
- 使用颜色对话框来取色
- PyQt5学习教程14:颜色拾取对话框的使用
- pyqt5之QColorDialog颜色对话框最简单使用
- 图形的绘制,如何使用自定义画笔(颜色,线宽,线形)。如何为程序中添加选项菜单和选项设置对话框,如何使用标准颜色对话框,如何使用字体对话框,在选项对话框中实现预览功能。实现选项对话框和窗口类中的数据交换。如何改变对话框和控件的背景色,如何改变控件的文本颜色,
- MFC对话框如何使用工具栏并修改工具栏的背景颜色与自绘对话框统一
- java使用颜色对话框
- 安卓Andriod使用入门(二十)【颜色对话框】
- .NET下使用ZWCAD标准对话框选择颜色
- 颜色、字体对话框使用实例
- MFC颜色对话框的使用
- 文件、颜色、字体标准对话框使用
- MFC中颜色选择对话框的使用
- MFC对话框如何使用工具栏并修改工具栏的背景颜色与自绘对话框统一(二)
- 颜色对话框使用实例
- MFC颜色对话框使用
- MFC颜色对话框的使用
- 颜色对话框CColorDialog,字体对话框CFontDialog使用实例
- MFC颜色对话框的使用
- MFC颜色对话框的使用