Results 1 to 3 of 3

Thread: A error occurred in GDI+ (datagrid mousemove)

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2006
    Posts
    28

    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 ?

  2. #2
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    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...

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2006
    Posts
    28

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width