Results 1 to 2 of 2

Thread: Strange Error ?? to do with Combobox ?

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    9

    Question Strange Error ?? to do with Combobox ?

    I have a simple form in VB.Net with some combobox filled with text from an array.

    The error message i'm getting is:

    An unhandled exception of type 'System.ArithmeticException' occurred in system.windows.forms.dll

    Additional information: Overflow or underflow in the arithmetic operation.
    Everytime the form looses focus after filling the comboboxes with this array it crashes with the above message.

    I am filling the comboboxes with the following code:
    Code:
    Dim cname() As String
    
            '    Get number of system components - TQNOSC(number of system components variable, noerr)
            Call tqnosc(nscom, noerr)
            ReDim cname(nscom)
    
            For i = 1 To nscom 
                '        Get names of system components - TQGNSC(Phase index number, component name, noerr)
                Call tqgnsc(i, cName(i), noerr)
                Species1_Combo.Items.Add(cName(i))
                Species2_Combo.Items.Add(cName(i))
                Species3_Combo.Items.Add(cName(i))
                Species4_Combo.Items.Add(cName(i))
            Next i
    To duplicate the error I run that code and select something in one of more of the comboboxes then leave the form (minimise or just switch to a different program)

    Any ideas ?? Can't seem to use the combo box without the form crashing all the time !

  2. #2

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    9
    It's ok sort of. Nothing to do with the combo boxes rather a with the following paint sub:

    Private Sub frmMain_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles _
    MyBase.Paint

    got rid of it and now there's no more crashing. Didn't really need it anyway

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