I made several images with transparent backgrounds for a column of datagridview cells, thinking I could easily set the background color of the cell to whatever I want depending on the alternating rows and highlighted row.
It's simple code and it should work (this is in the event to fill the datagridview for alternating row colors; the image is in the last column):
The results are ugly; the transparent parts of the images shine right through to my coding window. My code has no effect on the images whatsoever.Code:Dim RowCount As Integer = dgvRoster.Rows.Count - 1 Dim Cell As DataGridViewCell = dgvRoster.Rows(RowCount).Cells.Item(dgvRoster.Columns.Count - 1) If RowCount Mod 2 = 0 Then Cell.Style.BackColor = Color.AliceBlue Else : Cell.Style.BackColor = Color.Azure End If
I'm wondering if there's a better image format for transparentcies than the one I chose (.gif). Would jpegs or some other format yield better results or am I totally barking up the wrong tree with my approach?





Reply With Quote