Hi,
In a form called form1 I have a combobox and a color dialog and a button. For each item in combobox I will select a color and click the OK button. On clicking the OK button I will store the itemname of combobox and colorcode(hashcode) of that color in a db table called itemcolor. Now in another form called form2 I have a datagridview and a combobox. When I select a item in combobox of form2 the datagridview's first row should be set to the color which matches the itemname selected in the combobox of form2 with the itemname stored in the database.
Now my question is how to apply color hash code in particular row of gridv Like,
(which type of variable to use here ?? ) =colordailog1.color.gethashcode();
and also when I stored the itemname and color for each item some of the code's value are negative like -876890,-2243678, etc. Is it no problem?
Thanks
Loading

Deepak Pathak108 reputationPosted Jun 18, 2009, 12:26 AM EDT
sachi vasishta180 reputationPosted Jun 18, 2009, 2:38 AM EDT
Thanks
Kirtan PatelRank #292 · 8.6K reputationPosted Jun 18, 2009, 3:49 AM EDT
using System.Drawing; private void button1_Click(object sender, EventArgs e) { string ColorCode = ColorTranslator.ToHtml(textBox1.BackColor); textBox2.Text = ColorCode; textBox2.BackColor = ColorTranslator.FromHtml(ColorCode); }sachi vasishta180 reputationPosted Jun 18, 2009, 5:06 AM EDT
thanks
Kirtan PatelRank #292 · 8.6K reputationPosted Jun 18, 2009, 5:32 AM EDT