0

I have a fixed size grid and would like to specify the backcolor of specific cells within the grid, so not whole rows and not whole columns just a single cell or maybe a range of cells. Please see the screenshot below for and example of what I mean.

Ideally I would like to do this via vb as I would ultimately like to alter the backcolor based on values selected from a dropdown list.

enter image description here

Edit:

Based on the answer below I modified it until I got the below which worked.

GridView.Rows(n).Cells(n).BackColor = Drawing.Color.FromArgb(n, n, n)
4

1 回答 1

1

Assuming you are creating a windows forms application, you can use the DataGridView. It allows individual cells to be styled using the following property:

dataGridView1.Rows[0].Cells[0].Style.BackColor = Color.Red
于 2013-05-02T11:35:02.163 回答