Hi all
here i use data grid view row post paint to set a row icons for my datagridview , for example:
Private Sub DataGridView1_RowPostPaintRed( _
ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) _
Handles DataGridView1.RowPostPaint
For Each row As DataGridViewRow In DataGridView1.Rows
Dim myBitmap As New Bitmap(ImageList1.Images(0))
Dim myIcon As Icon = Icon.FromHandle(myBitmap.GetHicon())
Dim graphics As Graphics = e.Graphics
Dim iconHeight As Integer = 14
Dim iconWidth As Integer = 14
Dim xPosition As Integer = e.RowBounds.X + (DataGridView1.RowHeadersWidth \ 2)
Dim yPosition As Integer = e.RowBounds.Y + ((DataGridView1.Rows(e.RowIndex).Height - iconHeight) \ 2)
Dim rectangle As New Rectangle(xPosition, yPosition, iconWidth, iconHeight)
graphics.DrawIcon(myIcon, rectangle)
in this private sub i use my 1st image from image list (Red)
My question is :
how can i use that private subs in this sub :
Private Sub myUpdate(ByVal str As String)
Dim jo As JObject = JObject.Parse(str), temp As String, val As String
For Each row As DataGridViewRow In DataGridView1.Rows
temp = row.Cells(0).Value.ToString
val = jo(temp)
If row.Cells(1).Value < val Then
Else
End If
row.Cells(1).Value = val
row.Cells(2).Value = fractionPart(2, val)
Next
End Sub