I had been try for along time to change the color of my column headers in a datagridview. I was using the following code and it never worked.
DataGridViewCellStyle style =
dataGridView1.ColumnHeader
sDefaultCe
llStyle;
style.BackColor = Color.Red;
style.ForeColor = Color.White;
dataGridView1.ColumnHeader
sDefaultCe
llStyle = style;
I finally gave up on it but left the code in there. Then I installed my program on someone elses computer and magically the column headers were a different color. I finally figured out that the difference was that I had my display settings set for Windows XP style, while the other person had Windows Classic Style.
Is there a way to 1) change the column headers in XP Style, or 2) force Windows XP Style to be applied requardless of the user's display settings?
Start Free Trial