Set datagrid view background to transparent

后端 未结 5 1629
萌比男神i
萌比男神i 2020-12-11 07:04

I tried to set the background color of a data grid view to be \"transparent\" from properties but it it said \"not a valid property\".

How can I do it?

5条回答
  •  旧时难觅i
    2020-12-11 07:50

    You need to set all the rows and columns to transparent. Easier way is:

    for (int y = 0; y < gridName.Rows[x].Cells.Count; y++)
    {
         yourGridName.Rows[x].Cells[y].Style.BackColor =
         System.Drawing.Color.Transparent;
    }
    

提交回复
热议问题