Results 1 to 5 of 5

Thread: listbox Broken?

  1. #1

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    listbox Broken?

    I tried adding a listbox to one of my forms and I get this error when the form loads:

    Code:
    An exception of type 'System.ArgumentException' occurred in System.Windows.Forms.dll and wasn't handled before a managed/native boundary
    
    Additional information: Value does not fall within the expected range.
    And it doesnt show me what is causing it. I have added listboxes to other applications but it doesnt seem to like this project... I have since opted to use listview since i find it better anyway. But still...

    Name:  Capture.jpg
Views: 378
Size:  33.4 KB

  2. #2
    Frenzied Member
    Join Date
    Oct 2012
    Location
    Tampa, FL
    Posts
    1,187

    Re: listbox Broken?

    Quote Originally Posted by dclamp View Post
    I tried adding a listbox to one of my forms and I get this error when the form loads:

    Code:
    An exception of type 'System.ArgumentException' occurred in System.Windows.Forms.dll and wasn't handled before a managed/native boundary
    
    Additional information: Value does not fall within the expected range.
    And it doesnt show me what is causing it. I have added listboxes to other applications but it doesnt seem to like this project... I have since opted to use listview since i find it better anyway. But still...

    Name:  Capture.jpg
Views: 378
Size:  33.4 KB
    I have no problems adding listboxes to any projects. If you get past the Me.Startup event, you could try adding a handler to get the underlying exception information:

    Code:
    Private Sub MyApplication_Startup(sender As Object, e As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup
            AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf CatchUnhandledExceptions
        End Sub
    
        Private Sub CatchUnhandledExceptions(sender As Object, e As UnhandledExceptionEventArgs)
            Messagebox.Show(e.ExceptionObject.ToString())
        End Sub

  3. #3
    Hyperactive Member
    Join Date
    Sep 2014
    Posts
    404

    Re: listbox Broken?

    Drill down into the error details you should be able to gets. More specific error to then determine what is causing it .

    What are you doing with the list box in the form ?

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: listbox Broken?

    I've had this happen when I mungle a control name... open the designer file, and look for the newly added listbox, you may even get a design-time syntax error message that will tell you the root of the issue.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: listbox Broken?

    When i get a second I will play around with it some more.

    Simply adding the control to a form and loading the form as enough to cause the error. There is no interaction with the listbox.

    I will follow up

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