A error occurred in GDI+ (datagrid mousemove)
I developed a code in datagrid mousemove event to get the data of the columns and put it into the textbox. Every time I move the mouse over the data grid, the CPU utilization (taskmgr) increases to 100% and the follow error occurs :
A Generic error occurred in GDI+.
Would you please help me ?
Re: A error occurred in GDI+ (datagrid mousemove)
I would think that if you want us to know whats wrong with your code, then you should probably give us some of your code...
Re: A error occurred in GDI+ (datagrid mousemove)
I´m sorry. I've been traveling.
Follows code :
Try
Dim pt = New Point(e.X, e.Y)
Dim hit As DataGrid.HitTestInfo = DataGridPessoas.HitTest(pt)
If hit.Type = Windows.Forms.DataGrid.HitTestType.cell Then
If bMouseColumn = False Then
PanelMensagens.Text = "Clique no cabeçalho da grid"
PanelMensagens.Icon = t.g_CapturaIconeDeImagelist(ImgListIcones, 8)
bMouseColumn = True
bMouseCell = False
bMouseIdle = False
End If
******************************************
'Get Icon from Imagelist Object
Public Function g_CapturaIconeDeImagelist(ByVal moNomeImageList As ImageList, _
ByVal nIndiceImagem As Int32) As Icon
Dim objBitmap As Bitmap
Dim objIcon As Icon
Try
objBitmap = New Bitmap(moNomeImageList.Images(nIndiceImagem))
objIcon = System.Drawing.Icon.FromHandle(objBitmap.GetHicon)
g_CapturaIconeDeImagelist = objIcon
Catch ex As Exception
MessageBox.Show(ex.Message, ex.Source, MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Function