How do I color a cell in a datagridview with the alpha-channel? 开发者_开发百科 RGB works ok, but when specifying the alpha I get distorted numbers instead. I make this color change in the cellPainting event.
e.CellStyle.BackColor = Color.FromArgb(120, 255, 0, 0)
Well, it's working. Your screen shot shows the cell in the 3rd row getting different values and getting repainted without the BackColor erasing what was there before. It's several digits drawn on top of each other, looks like a 4, 5 and 6. You get more interesting effects by making the DGV smaller so a horizontal scrollbar appears. Dragging it produces a 'smear' of digits.
This just doesn't work very well, not sure why you want to do this. You want a good opaque background to draw new values on. That requires an alpha of 255.
精彩评论