Results 1 to 6 of 6

Thread: [RESOLVED] [2005] Cell Image Backgrounds

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member neef's Avatar
    Join Date
    Dec 2001
    Location
    Boston
    Posts
    311

    [RESOLVED] [2005] Cell Image Backgrounds

    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):
    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
    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.

    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?
    Last edited by neef; Dec 16th, 2007 at 08:35 AM.
    Intermediate Level Programmer Extraordinaire

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width