Results 1 to 5 of 5

Thread: [RESOLVED]combobox items

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2005
    Posts
    29

    [RESOLVED]combobox items

    During Debugging

    Private Sub A18607_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Me.cboStation.Items(0) = "San Diego, CA"
    Me.cboStation.Items(1) = "San Fransisco, CA"
    Me.cboStation.Items(2) = "Sacramento, CA"
    Me.cboStation.Items(3) = "Santa Barbara, CA"


    error box comes in
    with that fist item highlighted
    "An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in system.windows.forms.dll

    Additional information: Specified argument was out of the range of valid values."

    i dont get it cause right below that i have the added the items of another combobox without a hassle. Anyone know whats up?
    Last edited by Gjobson; Apr 10th, 2006 at 06:19 PM.

  2. #2
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,817

    Re: combobox items

    Quote Originally Posted by Gjobson
    During Debugging

    Private Sub A18607_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Me.cboStation.Items(0) = "San Diego, CA"
    Me.cboStation.Items(1) = "San Fransisco, CA"
    Me.cboStation.Items(2) = "Sacramento, CA"
    Me.cboStation.Items(3) = "Santa Barbara, CA"


    error box comes in
    with that fist item highlighted
    "An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in system.windows.forms.dll

    Additional information: Specified argument was out of the range of valid values."

    i dont get it cause right below that i have the added the items of another combobox without a hassle. Anyone know whats up?
    Hi,

    You could try this,

    VB Code:
    1. Private Sub A18607_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.  
    3.       Me.cboStation.Items.Add("San Diego, CA")
    4.       Me.cboStation.Items.Add("San Fransisco, CA")
    5.       Me.cboStation.Items.Add("Sacramento, CA")
    6.       Me.cboStation.Items.Add("Santa Barbara, CA")
    7. End Sub

    Hope it helps,

    sparrow1
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2005
    Posts
    29

    Re: combobox items

    you're a good person

  4. #4
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,817

    Re: combobox items

    Quote Originally Posted by Gjobson
    you're a good person
    No problem, glad to help!
    Mark your thread as resolved.

    Wkr,

    sparrow1
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  5. #5
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,817

    Re: combobox items

    Quote Originally Posted by Gjobson
    you're a good person?
    BTW, this code is working for me very well without any Error!
    I've tested before posting!

    VB Code:
    1. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.  
    3.         Me.cboStation.Items.Add("San Diego, CA")
    4.         Me.cboStation.Items.Add("San Fransisco, CA")
    5.         Me.cboStation.Items.Add("Sacramento, CA")
    6.         Me.cboStation.Items.Add("Santa Barbara, CA")
    7.  
    8.     End Sub


    sparrow1
    Last edited by sparrow1; Apr 10th, 2006 at 05:35 PM.
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

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