When I try to bind two comboboxes to the same datatable, both boxes show the same values, changing one changes the other. How do I make them have distinct values

Make sure the two comboboxes use different BindngContext objects. BindingContext bc = new BindingContext(); this.comboBox1.BindingContext = bc; comboBox1.DataSource = _dataSet.Tables[‘orders’]; comboBox1.ValueMember = ‘CustomerID’; comboBox1.DisplayMember = ‘CustomerID’; bc = new BindingContext(); this.comboBox2.BindingContext = bc; comboBox2.DataSource = _dataSet.Tables[‘orders’]; comboBox2.ValueMember = ‘CustomerID’; comboBox2.DisplayMember = ‘CustomerID’;

How do I draw an image with a gray scale?

Here is some code: // Not the closest grayscale representation in the RGB space, but // pretty close. // Closest would be the cubic root of the product of the RGB colors, // but that cannot be represented in a ColorMatrix. public void DrawGrayedImage(Graphics g, Image image, int left, int top) { ImageAttributes ia = new ImageAttributes(); ColorMatrix cm = new ColorMatrix(); // 1/3 on the top 3 rows and 3 columns cm.Matrix00 = 1/3f; cm.Matrix01 = 1/3f; cm.Matrix02 = 1/3f; cm.Matrix10 = 1/3f; cm.Matrix11 = 1/3f; cm.Matrix12 = 1/3f; cm.Matrix20 = 1/3f; cm.Matrix21 = 1/3f; cm.Matrix22 = 1/3f; ia.SetColorMatrix(cm); g.DrawImage(image, new Rectangle(left, top, image.Width, image.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, ia); }