wakjdhlaw890
Checkpoint Master
LEVEL 1
200 XP
Today, I will teach you how to create a program that displays all countries in the world using globalization in VB.NET.
Now, let's start this tutorial!
1. Let's start with creating a Windows Form Application for this tutorial by following the following steps in Microsoft Visual Studio: Go to File, click New Project, and choose Windows Application.
2. Next, add only one ListBox named ListBox1 to display the countries. You must design your interface like this:
3. Now, we will do the coding.
Initialize the following variables:
For the Form_Load, have this code below:
Output:
For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below.
Best Regards,
Engr. Lyndon Bermoy
IT Instructor/System Developer/Android Developer/Freelance Programmer
Mobile: 09488225971
Landline: 826-9296
E-mail:[email protected]
Add and Follow me on Facebook: https://www.facebook.com/donzzsky
Visit and like my page on Facebook at: https://www.facebook.com/BermzISware
Download
Now, let's start this tutorial!
1. Let's start with creating a Windows Form Application for this tutorial by following the following steps in Microsoft Visual Studio: Go to File, click New Project, and choose Windows Application.
2. Next, add only one ListBox named ListBox1 to display the countries. You must design your interface like this:

3. Now, we will do the coding.
Initialize the following variables:
- 'to sort all the values of the listbox
- Dim
lbox As
New
ListBox With
{
.
Sorted
=
True
}
- ' determines the name of the country
- Dim
Countryname, CurrentComputerCulture As
String
- ' determines the index of the country in the ListBox
- Dim
CountryIndex As
Int32
For the Form_Load, have this code below:
- Private
Sub
Form1_Load(
ByVal
sender As
System.
Object
, ByVal
e As
System.
EventArgs
)
Handles
MyBase
.
Load
- ' this code access and passess the country name using the Globalization to String named CurrentComputerCulture
- CurrentComputerCulture =
Globalization.
RegionInfo
.
CurrentRegion
.
DisplayName
- For
Each
Country In
Globalization.
CultureInfo
.
GetCultures
(
Globalization.
CultureTypes
.
InstalledWin32Cultures
)
- 'change region
- My.
Application
.
ChangeCulture
(
Country.
Name
)
- Countryname =
Globalization.
RegionInfo
.
CurrentRegion
.
DisplayName
- If
ListBox1.
Items
.
Contains
(
Countryname)
=
False
Then
- 'add country name
- ListBox1.
Items
.
Add
(
Countryname)
- lbox.
Items
.
Add
(
Countryname &
"/"
&
Globalization.
RegionInfo
.
CurrentRegion
.
CurrencyNativeName
&
" = "
&
Globalization.
RegionInfo
.
CurrentRegion
.
CurrencySymbol
)
- End
If
- 'clear cached data
- My.
Application
.
Culture
.
ClearCachedData
(
)
- Next
- ' put the index to the countries in the listbox
- If
lbox.
Items
.
Count
>
0
Then
- CountryIndex =
ListBox1.
FindString
(
CurrentComputerCulture)
- lbox.
SelectedIndex
=
CountryIndex
- ListBox1.
SelectedIndex
=
CountryIndex
- End
If
- End
Sub
Output:

For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below.
Best Regards,
Engr. Lyndon Bermoy
IT Instructor/System Developer/Android Developer/Freelance Programmer
Mobile: 09488225971
Landline: 826-9296
E-mail:[email protected]
Add and Follow me on Facebook: https://www.facebook.com/donzzsky
Visit and like my page on Facebook at: https://www.facebook.com/BermzISware
Download
You must upgrade your account or reply in the thread to view hidden text.