Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7922745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:04:21+00:00 2026-06-03T17:04:21+00:00

I’ve been working on a VB project where I use a 1st drop down

  • 0

I’ve been working on a VB project where I use a 1st drop down list to select a movie category and then in the 2nd drop menu, movies from that category will be displayed. The movies are stored in a 2-dimensional array by category.

With help from folks here, I’ve been able to edit my array but I’m having problems with my .AddRange() function. What would I have to put in those parentheses for the list (for each category) to appear in my 2nd combobox when the category is selected?

I tried:

  • .AddRange (movie_list_combobox)
  • .AddRange (movie_category_combobox)
  • .AddRange (Array(movie_list_combobox))
  • .AddRange (Array(movie_category_combobox))

Nothing has worked.

items changed:

  1. Updated array
  2. Instead of using if/else statement, I’m using for/next (no longer using Select Case either)
  3. added addRange()

I’ve attached my code below:

Public Class Video_Form

Private Sub count_textbox_TextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles count_textbox.TextChanged

End Sub

Private Sub Count_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Count.Click

  count_textbox.Text = Me.movie_list_combobox.Items.Count

End Sub

Private Sub movie_categories_combobox_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles movie_categories_combobox.SelectedIndexChanged

End Sub

Private Sub movie_list_combobox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles movie_list_combobox.SelectedIndexChanged

  Dim Movies(,) As String = {{"Meet", "Oxford", "Sterilite"}, {"Sunflower", "Seeds", ""}, {"Black Box", "", ""}, {"Dancing ", "", ""}, {"Dictionary", "", ""}, {"Glue", "Flight", ""}}

  Dim row As Integer
  Dim column As Integer

  For movie_categories_combobox.SelectedIndex = 0 Then
    row = 0 To 2
    column = 0 To 0
    movie_list_combobox.Items.Clear()
    movie_list_combobox.Items.AddRange()
  Next

  For movie_categories_combobox.SelectedIndex = 1 Then
    row = 0 To 1
    column = 1 To 1
    movie_list_combobox.Items.Clear()
    movie_list_combobox.Items.AddRange()
  Next

  For movie_categories_combobox.SelectedIndex = 2 Then
    row = 0 To 0
    column = 2 To 2
    movie_list_combobox.Items.Clear()
    movie_list_combobox.Items.AddRange()
  Next

  For movie_categories_combobox.SelectedIndex = 3 Then
    row = 0 To 0
    column = 3 To 3
    movie_list_combobox.Items.Clear()
    movie_list_combobox.Items.AddRange()
  Next

  For movie_categories_combobox.SelectedIndex = 4 Then
    row = 0 To 0
    column = 4 To 4
    movie_list_combobox.Items.Clear()
    movie_list_combobox.Items.AddRange()
  Next

  For movie_categories_combobox.SelectedIndex = 5 Then
    row = 0 To 1
    column = 5 To 5
    movie_list_combobox.Items.Clear()
    movie_list_combobox.Items.AddRange()
  Next

  '//End If
  '//End Select

End Sub

Please let me know what part(s) of my code are wrong.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T17:04:23+00:00Added an answer on June 3, 2026 at 5:04 pm

    In my opinion your problem isn’t very clear…btw maybe i can help you by telling you what would i do if i were in you.
    I’ll declare a 2 dimension array in this way….for ex. funny films at index 0 and kolossal at index 1….

     Dim array as new string(1,2) ={{"Scary movie", "Ace ventura", "American pie"},   {"Titanic", "avatar", "quo vadis"}}
    

    Then, populate the movie category combobox:

     movie_category_combobox.items.addRange(new string(){"Funny movies", "Kolossal"})
    

    Finally, when the movie_category_combobox.SelectedIndexChanged has thrown, you only need to:

     'clear the movie combobox
     movie_list_combobox.items.clear() 
    
     'fill the movie combobox with the index at the selected position 
     movie_list.combobox.items.addrange(array(movie_category_combobox.selectedIndex) )
    

    Hope it helps….

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.