Determine Country Currency and Symbol in VB.NET
Submitted by donbermoy on Wednesday, April 29, 2015 - 22:21.
This tutorial will teach you how to create a program that will first display all the countries in the world and will determine the currency of the country inputted using 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 ComboBox named ComboBox1 to view all the countries in the world, a Button named ButtonCheck to determine the currency and symbol of the country, and a Label named LabelInfo for displaying the currency and symbol of the country. You must design your interface like this:
3. Now, let's do the coding.
Initalize first the following variables:
In your Form_Load, put this code below for displaying the countries in the ComboBox.
For determining the country's currency and symbol put this code in your ButtonCheck_click.
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

- ' for sorting the combobox
- Dim cbox As New ComboBox With {.Sorted = True}
- ' for the country, currency name and symbol
- Dim Countryname, Currencyname, Currencysymbol, CurrentComputerCulture As String
- ' country index in the combobox
- Dim CountryIndex As Int32
- ' currency index
- Dim i As Int32
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- 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 ComboBox1.Items.Contains(Countryname) = False Then
- 'add country name
- ComboBox1.Items.Add(Countryname)
- cbox.Items.Add(Countryname & "/" & Globalization.RegionInfo.CurrentRegion.CurrencyNativeName & " = " & Globalization.RegionInfo.CurrentRegion.CurrencySymbol)
- End If
- 'clear cached data
- My.Application.Culture.ClearCachedData()
- Next
- If cbox.Items.Count > 0 Then
- CountryIndex = ComboBox1.FindString(CurrentComputerCulture)
- cbox.SelectedIndex = CountryIndex
- ComboBox1.SelectedIndex = CountryIndex
- End If
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCheck.Click
- 'get the chosen country in the combobox
- i = ComboBox1.FindString(ComboBox1.Text)
- cbox.SelectedIndex = i
- ' get the currency name
- Currencyname = cbox.SelectedItem.ToString.Remove(0, cbox.SelectedItem.ToString.IndexOf("/") + 1)
- Currencyname = Currencyname.Substring(0, Currencyname.IndexOf("="))
- ' get the currency symbol
- Currencysymbol = cbox.SelectedItem.ToString.Remove(0, cbox.SelectedItem.ToString.IndexOf("=") + 1).Trim
- LabelInfo.Text = ComboBox1.Text & " currency is " & Currencyname & Environment.NewLine & "Currency Symbol: " & Currencysymbol
- End Sub
Output:

Add new comment
- 486 views