Datagrid BackGround Image

  • Thread starter Thread starter Michael Turner
  • Start date Start date
M

Michael Turner

Anyone know if you can add a background image to a datagrid, there is a
property for colour but not for an image.
 
This should work, but does not. I am close. Any ideas?
Private Sub AddMyDataGrid()
' Create a button and add it to the form.
Dim dgrNewDataGrid As New DataGrid

' Anchor the datagrid to the left corner of the form
dgrNewDataGrid.Anchor = AnchorStyles.Left

' Assign a background image.
dgrNewDataGrid.BackgroundImage = Image.FromFile("C:\Documents and
Settings\Rachel D Kozlowski\My Documents\My Pictures\1.jpg")

' Make the datagrid the same size as the image.
dgrNewDataGrid.Size = dgrNewDataGrid.BackgroundImage.Size

' Add the datagrid to the form.
Me.Controls.Add(dgrNewDataGrid)
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Background image of DataGrid 2
BackGroundImage 2
VB.NET 2003 DataGrid 1
detect missing images 3
VB.NET Datagrid with pictures 8
WPF Skinning 2
Autofill datagridview using the criteria 4
PowerPoint High Resolution Images from PowerPoint 0

Back
Top