|
-
Jan 3rd, 2009, 02:19 AM
#1
Thread Starter
Lively Member
[RESLOVED][vbe 2008] DataGridView button color
Hi,
I am trying to add rows containing a button to a Datagridrow control and would like the button to be red. When I use the code below the button does not turn red but the cell containing the button does. How can I turn the button red? Thanks.
Private Sub AddRow(ByVal Product As String, ByVal Stock As String)
Dim NewRow As DataGridViewRow = New DataGridViewRow
Dim CellButton As DataGridViewCell
CellButton = New DataGridViewButtonCell
CellButton.Value = Stock
CellButton.Style.BackColor = Color.Red
NewRow.Cells.Add(CellButton)
DataGridView1.Rows.Add(NewRow)
DataGridView1.AutoResizeColumns()
End Sub
Last edited by DC123; Jan 4th, 2009 at 05:49 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|