Trevor Finch
2016-04-24T02:19:25Z
We have a requirement to display simple diagram/gauge

eg: The example enumerating a drive - the total file size could be shown as a horizontal bar

We tried code like this with MSFlexGrid...

With Me.HSFlexGrid1
For li_row = 1 To .Rows
'Me.Pic_Temp.AutoRedraw = False/True
'draw on hidden VB.PictureBox
Me.Pic_Temp.BackColor = vbBlue 'also CLS
Me.Pic_Temp.Line (0, 0)-(Me.Pic_Temp.ScaleWidth, Me.Pic_Temp.ScaleHeight * (li_Row / .Rows)), vbRed, BF

.Row = li_Row
.Col = 2 'GaugeColumn
.CellPictureAlignment = flexAlignCenterCenter
Set .CellPicture = Me.Pic_Temp.Picture

works ok if you use .Image

Set .CellPicture = Me.Pic_Temp.Image

(https://msdn.microsoft.com/en-us/library/aa239858%28v=vs.60%29.aspx implies it should)

With the iGrid, can we assign a .Picture at runtime ?

Does iGrid have an HDC, and is it available ?
Igor/10Tec
2016-04-25T07:17:33Z
If you want to use pictures for this, you need to use iGrid cell icons and an image list control. Upload required images into the image list and display them in iGrid cells using the CellIcon property.

An alternative and more powerful way is custom drawing. You can use the classic WinAPI drawing functions on a GDI device context to draw custom cell contents. The VB6 demo contains some examples of that. One of them is the Folder Size Manager tool based on iGrid:

Folder Size Manager.png

Click to View Image194 View(s)

Trevor Finch
2016-04-25T08:13:53Z
Thanks, excellent - should have carried on checking examples