Click here to Skip to main content
15,884,020 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am using VB.Net in visual studio 2008
some times not every time, i press close button want to exit application an error accurre A generic error occurred in GDI+
My Source code here

VB
Private Sub mnuClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuClose.Click
       Dim msg As Integer
       msg = (MessageBox.Show("Are You Sure, want to Exit...?", "Close...?", MessageBoxButtons.YesNo, MessageBoxIcon.Question))

     If msg = 6 Then

           End

       End If
   End Sub
Posted
Updated 21-Sep-15 8:53am
v2
Comments
Ralf Meier 20-Sep-15 10:41am    
I suppose that you think that your Error occures in the posted code-lines.
I don't believe that too ...

Perhaps, you used the wrong type for msg (MessageBox delivers you a return as DialogResult - that is an Enum which could be much better used in the following code) but I can't believe that this is the Error - I must come from elsewhere ...
Baloch_khan 26-Sep-15 14:16pm    
i am new in codeproject.com,
there is any option that i upload error screenshot..?
Ralf Meier 28-Sep-15 10:14am    
I don't believe that your screenshot would be helpful (in this case).
At which programm-line does the development-system stops the programm-execution ?

1 solution

Sounds like you're working with images. Probably, you did not finish writing data into image.

See similar questions:
A generic error occurred in GDI+[^]
A generic error occurred in GDI+[^]
A generic error occurred in GDI+[^]
 
Share this answer
 
Comments
CPallini 21-Sep-15 15:57pm    
5.
Maciej Los 21-Sep-15 15:58pm    
Thank you, Carlo.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900