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

  • Home
  • SEARCH
  • 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 7556157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:47:48+00:00 2026-05-30T11:47:48+00:00

I’m Using Visual Basic 2010, and what i want know is how i can

  • 0

I’m Using Visual Basic 2010, and what i want know is how i can create different list on a single ComboBox…
practically i’ve 2 ComboBox… the first with a list of Items inside.. and i want to create a second ComboBox With Different types of list based on the choice of the first ComboBox..

Ex: First Combobox with all the continents and the secondo ComboBox With all the Nations, i want that the Nations list of the Second ComboBox change according to the Country selected from the list of the first ComboBox…

  • 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-05-30T11:47:49+00:00Added an answer on May 30, 2026 at 11:47 am

    Here are two classes that represents country and continent :

    'Coded by Amen Ayach's DataClassBuilder @25/02/2012
    Public Class CountryCls
    
        Private _CountryID As Integer
        Public Property CountryID() As Integer
            Get 
                Return _CountryID
            End Get
            Set(ByVal value As Integer)
                _CountryID = value
            End Set
        End Property
    
        Private _CountryName As String
        Public Property CountryName() As String
            Get 
                Return _CountryName
            End Get
            Set(ByVal value As String)
                _CountryName = value
            End Set
        End Property
    
        Private _ContinentID As Integer
        Public Property ContinentID() As Integer
            Get 
                Return _ContinentID
            End Get
            Set(ByVal value As Integer)
                _ContinentID = value
            End Set
        End Property
    
    End Class
    
    
    'Coded by Amen Ayach's DataClassBuilder @25/02/2012
    Public Class ContinentCls
    
        Private _ContinentID As Integer
        Public Property ContinentID() As Integer
            Get 
                Return _ContinentID
            End Get
            Set(ByVal value As Integer)
                _ContinentID = value
            End Set
        End Property
    
        Private _ContinentName As String
        Public Property ContinentName() As String
            Get 
                Return _ContinentName
            End Get
            Set(ByVal value As String)
                _ContinentName = value
            End Set
        End Property
    
    End Class
    

    Now add two ComboBoxs to a form named cmbContinent and cmbCountry, then add the following code to your form :

    Dim ContinentList As New List(Of ContinentCls)
    Dim CountryList As New List(Of CountryCls)
    
    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
        'Initialize some fake data
        For i = 1 To 3
            ContinentList.Add(New ContinentCls With {.ContinentID = i, .ContinentName = "Continent" + CStr(i)})
            For j = 1 To 5
                CountryList.Add(New CountryCls With {.ContinentID = i, .CountryID = j, .CountryName = "Cont" + CStr(i) + " - Country" + CStr(j)})
            Next
        Next
    
        'Filling out ContinentCombo
        With cmbContinent
            .ValueMember = "ContinentID"
            .DisplayMember = "ContinentName"
            .DataSource = ContinentList
        End With
    
    End Sub
    
    Private Sub cmbContinent_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmbContinent.SelectedValueChanged
        Try
            'Filling out CountryCombo according to seleced ContinentCombo
            With cmbCountry
                .ValueMember = "CountryID"
                .DisplayMember = "CountryName"
                .DataSource = CountryList.Where(Function(f) f.ContinentID = cmbContinent.SelectedValue).ToList
            End With
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
We're building an app, our first using Rails 3, and we're having to build
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to create an if statement in PHP that prevents a single post
I'm making a simple page using Google Maps API 3. My first. One marker
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the

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.