您的位置:首页 > 移动开发 > Objective-C

颜色对话框使用

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;

            }

        }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  textbox user button object