Hi Guys.
This is a question about the juicy little MS/Component1 freeby flexgrid =
that was very nicely spotted by Ken Tucker.
=
http://www.componentone.com/products.aspx?ProductCode=3D1&ProductID=3D17 http://msdn.microsoft.com/vbasic/vbrkit/default.aspx This code is to set a style to any cell I click on in the grid and it =
works fine but for one thing. As well as formatting the font, bgcolor =
etc I want to install a small picture in each cell. Has anyone come =
accross this yet using styles? Examples are scarce on the component1 =
website so maybe someone with a more robust experience of grids will =
know.
I've been banging my head all about the ImageMap Property of the =
CellStyle class and while I seem to be able to get the images in there =
using a hash table I can't get them back out?!?! There is a work around =
in the code too so the images do go into the cells for sure.
Ray.
Dublin, Ireland.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As =
System.EventArgs) Handles MyBase.Load
CreateStyles()
End Sub
Private Sub CreateStyles()
Dim cs As CellStyle
MyGrid.Styles.Add("CellStyle1", cs)
cs =3D MyGrid.Styles("CellStyle1")
cs.BackColor =3D Color.Yellow
cs.ForeColor =3D Color.Green
'Would also like to determine a picture for each cell here too!
End Sub
Private Sub mygrid_Click(ByVal sender As System.Object, ByVal e As =
System.EventArgs) Handles MyGrid.Click
MyGrid(MyGrid.Row, MyGrid.Col) =3D "Hello World"
MyGrid.SetCellStyle(MyGrid.Row, MyGrid.Col, =
MyGrid.Styles("CellStyle1"))
'Work Around - This line of code to place an image in a cell
MyGrid.SetCellImage(MyGrid.Row, MyGrid.Col, ImageList1.Images(0))
End Sub
Not sure if this is the 100% correct place for this post but it is a =