Tuesday, 15 April 2014

BACK GROUND AND FORE GROUND COLOR for all windows forms controls

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;
using System.IO;


namespace coltcolordialog
{
    public partial class Form1 : Form
    {
       
        public Form1()
        {
            InitializeComponent();
         
        }

        private void button1_Click(object sender, EventArgs e)
        {
       
            ColorDialog OBJ2 = new ColorDialog();
            OBJ2.ShowDialog();
            textBox1.ForeColor = OBJ2.Color;
         
         
        }

        private void button2_Click(object sender, EventArgs e)
        {
             {
       
            ColorDialog OBJ3 = new ColorDialog();
            OBJ3.ShowDialog();
       
            textBox1.BackColor= OBJ3.Color;
         
        }
        }

        private void button3_Click(object sender, EventArgs e)
        {
         

        }

        private void Form1_Load(object sender, EventArgs e)
        {
            this.BackColor = System.Drawing.Color.DarkGreen;
         
        }
    }
}

No comments:

Post a Comment