I have a question!
I have a custom class -
This class as you can see has both an Id and Name member. An example would be Name = "United States" Id = 0.
I have a combo box on my form, that I want to list the Name members in. So I will load a List (Of Location) into the combo box. A list of countries. However, the Id might not necessarily be numbered in any specific order. So when the person selects a country, I would like a currentLocation variable to be updated to that countries Id. How can I click on a country in the combo box and make sure, that at the same time, the currentLocation variable gets updated to that countries Id?
I have a custom class -
Code:
Public Class Location
Private m_Id As Integer
Private m_Name As String
Public Property Id As Integer
Get
Return m_Id
End Get
Set(ByVal value As Integer)
m_Id = value
End Set
End Property
Public Property Name As String
Get
Return m_Name
End Get
Set(ByVal value As String)
m_Name = value
End Set
End Property
End ClassI have a combo box on my form, that I want to list the Name members in. So I will load a List (Of Location) into the combo box. A list of countries. However, the Id might not necessarily be numbered in any specific order. So when the person selects a country, I would like a currentLocation variable to be updated to that countries Id. How can I click on a country in the combo box and make sure, that at the same time, the currentLocation variable gets updated to that countries Id?