Tuesday, 15 March 2016

How to Change DatagridView Header Color

 dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = ColorTranslator.FromHtml("#D7E2E4");
            dataGridView1.EnableHeadersVisualStyles = false;

Saturday, 12 March 2016

How to Set Text on Image MouseHover in C#

 private void pictureBox1_MouseHover(object sender, EventArgs e)
        {
            ToolTip tt = new ToolTip();
            tt.SetToolTip(this.pictureBox1, "Your Text");
        }

How to Change DataGrideView Header Color in C#

dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = ColorTranslator.FromHtml("#D7E2E4");
            dataGridView1.EnableHeadersVisualStyles = false;

Friday, 11 March 2016

send value from one form to another

1.on First Form
      
             New_POS.frm_updatetax fc = new frm_updatetax();
            fc.Tax_Id = TextBox1.Text;
            fc.Show();

2. On Second Form

            Public string Tax_Id ;
           TextBox1.Text=Tax_Id ;

Wednesday, 9 March 2016

programatically generate a click on a DataGridView Row in C#

  dataGridView1_CellClick(dataGridView1, new DataGridViewCellEventArgs(0, 0));

change the datagridview selected row background color

dataGridView1.DefaultCellStyle.SelectionBackColor = ColorTranslator.FromHtml("#FFC0BE");
            dataGridView1.DefaultCellStyle.SelectionForeColor = ColorTranslator.FromHtml("#FFFFFF"); 

Disable default cell selection in datagridView

DataGridView1.Rows[1].Cells[0].Selected = false;