Currency Converter

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
7 posts Page 1 of 1
Contributors
User avatar
MrAlicard
VIP - Donator
VIP - Donator
Posts: 54
Joined: Thu Aug 05, 2010 4:08 pm

Currency Converter
MrAlicard
Hello everybody!
Well, Currency converter is a simple tool that i've made with which you can convert easily and fastly any amount of money from one currency to another one. The "Convertions rates" are in real time, so you know that when you use the software, in that time, that amount of money worth.
That program/source code use xe.com website.

Video:
Image

Let's start!
A. Design

1. We use:
[*] 4 Label
[*] 2 Textbox
[*] 2 Combobox
[*] 1 ToolTip
[*] 2 Name on Settings

2. Options
[*] Form size: 255; 294
[*] Label1 text(Amount) and location value(86; 19)
[*] Label2 text(From:) and location value(91; 84)
[*] Label3 text(To:) and location value(100; 138)
[*] Label4 text(RESULT) and location value(90; 210)
[*] Textbox1 location value(53; 39)
[*] Textbox2 location value(8; 230)
[*] Combobox1 location value(8; 104)
[*] Combobox2 location value(8; 158)
[*] Combobox1 Items:
Code: Select all
USD - US Dollar
EUR - Euro
GBP - British Pound
INR - Indian Rupee
AUD - Australian Dollar
CAD - Canadian Dollar
SGD - Singapore Dollar
-------ALL CURRENCIES-------
AED - Emirati Dirham
AFN - Afghan Afghani
ALL - Albanian Lek
AMD - Armenian Dram
ANG - Dutch Guilder
AOA - Angolan Kwanza
ARS - Argentine Peso
AWG - Aruban or Dutch Guilder
AZN - Azerbaijani New Manat
BAM - Bosnian Convertible Marka
BBD - Barbadian or Bajan Dollar
BDT - Bangladeshi Taka
BGN - Bulgarian Lev
BHD - Bahraini Dinar
BIF - Burundian Franc
BMD - Bermudian Dollar
BND - Bruneian Dollar
BOB - Bolivian Boliviano
BRL - Brazilian Real
BSD - Bahamian Dollar
BTN - Bhutanese Ngultrum
BWP - Botswana Pula
BYR - Belarusian Ruble
BZD - Belizean Dollar
CDF - Congolese Franc
CHF - Swiss Franc
CLP - Chilean Peso
CNY - Chinese Yuan Renminbi
COP - Colombian Peso
CRC - Costa Rican Colon
CUC - Cuban Convertible Peso
CUP - Cuban Peso
CVE - Cape Verdean Escudo
CZK - Czech Koruna
DJF - Djiboutian Franc
DKK - Danish Krone
DOP - Dominican Peso
DZD - Algerian Dinar
EGP - Egyptian Pound
ERN - Eritrean Nakfa
ETB - Ethiopian Birr
FJD - Fijian Dollar
FKP - Falkland Island Pound
GBP - British Pound
GEL - Georgian Lari
GGP - Guernsey Pound
GHS - Ghanaian Cedi
GIP - Gibraltar Pound
GMD - Gambian Dalasi
GNF - Guinean Franc
GTQ - Guatemalan Quetzal
GYD - Guyanese Dollar
HKD - Hong Kong Dollar
HNL - Honduran Lempira
HRK - Croatian Kuna
HTG - Haitian Gourde
HUF - Hungarian Forint
IDR - Indonesian Rupiah
ILS - Israeli Shekel
IMP - Isle of Man Pound
INR - Indian Rupee
IQD - Iraqi Dinar
IRR - Iranian Rial
ISK - Icelandic Krona
JEP - Jersey Pound
JMD - Jamaican Dollar
JOD - Jordanian Dinar
JPY - Japanese Yen
KES - Kenyan Shilling
KGS - Kyrgyzstani Som
KHR - Cambodian Riel
KMF - Comoran Franc
KPW - North Korean Won
KRW - South Korean Won
KWD - Kuwaiti Dinar
KYD - Caymanian Dollar
KZT - Kazakhstani Tenge
LAK - Lao or Laotian Kip
LBP - Lebanese Pound
LKR - Sri Lankan Rupee
LRD - Liberian Dollar
LSL - Basotho Loti
LTL - Lithuanian Litas
LVL - Latvian Lat
LYD - Libyan Dinar
MAD - Moroccan Dirham
MDL - Moldovan Leu
MGA - Malagasy Ariary
MKD - Macedonian Denar
MMK - Burmese Kyat
MNT - Mongolian Tughrik
MOP - Macau Pataca
MRO - Mauritanian Ouguiya
MUR - Mauritian Rupee
MVR - Maldivian Rufiyaa
MWK - Malawian Kwacha
MXN - Mexican Peso
MYR - Malaysian Ringgit
MZN - Mozambican Metical
NAD - Namibian Dollar
NGN - Nigerian Naira
NIO - Nicaraguan Cordoba
NOK - Norwegian Krone
NPR - Nepalese Rupee
NZD - New Zealand Dollar
OMR - Omani Rial
PAB - Panamanian Balboa
PEN - Peruvian Nuevo Sol
PGK - Papua New Guinean Kina
PHP - Philippine Peso
PKR - Pakistani Rupee
PLN - Polish Zloty
PYG - Paraguayan Guarani
QAR - Qatari Riyal
RON - Romanian New Leu
RSD - Serbian Dinar
RUB - Russian Ruble
RWF - Rwandan Franc
SAR - Saudi or Saudi Arabian Riyal
SBD - Solomon Islander Dollar
SCR - Seychellois Rupee
SDG - Sudanese Pound
SEK - Swedish Krona
SHP - Saint Helenian Pound
SLL - Sierra Leonean Leone
SOS - Somali Shilling
SPL - Seborgan Luigino
SRD - Surinamese Dollar
STD - Sao Tomean Dobra
SVC - Salvadoran Colon
SYP - Syrian Pound
SZL - Swazi Lilangeni
THB - Thai Baht
TJS - Tajikistani Somoni
TMT - Turkmenistani Manat
TND - Tunisian Dinar
TOP - Tongan Pa'anga
TRY - Turkish Lira
TTD - Trinidadian Dollar
TVD - Tuvaluan Dollar
TWD - Taiwan New Dollar
TZS - Tanzanian Shilling
UAH - Ukrainian Hryvna
UGX - Ugandan Shilling
USD - US Dollar
UYU - Uruguayan Peso
UZS - Uzbekistani Som
VEF - Venezuelan Bolivar Fuerte
VND - Vietnamese Dong
VUV - Ni-Vanuatu Vatu
WST - Samoan Tala
XAF - Central African CFA Franc BEAC
XAG - Silver Ounce
XAU - Gold Ounce
XCD - East Caribbean Dollar
XDR - IMF Special Drawing Rights
XOF - CFA Franc
XPD - Palladium Ounce
XPF - CFP Franc
XPT - Platinum Ounce
YER - Yemeni Rial
ZAR - South African Rand
ZMK - Zambian Kwacha
ZWD - Zimbabwean Dollar
[*] Combobox2 Items:
Code: Select all
USD - US Dollar
EUR - Euro
GBP - British Pound
INR - Indian Rupee
AUD - Australian Dollar
CAD - Canadian Dollar
SGD - Singapore Dollar
-------ALL CURRENCIES-------
AED - Emirati Dirham
AFN - Afghan Afghani
ALL - Albanian Lek
AMD - Armenian Dram
ANG - Dutch Guilder
AOA - Angolan Kwanza
ARS - Argentine Peso
AWG - Aruban or Dutch Guilder
AZN - Azerbaijani New Manat
BAM - Bosnian Convertible Marka
BBD - Barbadian or Bajan Dollar
BDT - Bangladeshi Taka
BGN - Bulgarian Lev
BHD - Bahraini Dinar
BIF - Burundian Franc
BMD - Bermudian Dollar
BND - Bruneian Dollar
BOB - Bolivian Boliviano
BRL - Brazilian Real
BSD - Bahamian Dollar
BTN - Bhutanese Ngultrum
BWP - Botswana Pula
BYR - Belarusian Ruble
BZD - Belizean Dollar
CDF - Congolese Franc
CHF - Swiss Franc
CLP - Chilean Peso
CNY - Chinese Yuan Renminbi
COP - Colombian Peso
CRC - Costa Rican Colon
CUC - Cuban Convertible Peso
CUP - Cuban Peso
CVE - Cape Verdean Escudo
CZK - Czech Koruna
DJF - Djiboutian Franc
DKK - Danish Krone
DOP - Dominican Peso
DZD - Algerian Dinar
EGP - Egyptian Pound
ERN - Eritrean Nakfa
ETB - Ethiopian Birr
FJD - Fijian Dollar
FKP - Falkland Island Pound
GBP - British Pound
GEL - Georgian Lari
GGP - Guernsey Pound
GHS - Ghanaian Cedi
GIP - Gibraltar Pound
GMD - Gambian Dalasi
GNF - Guinean Franc
GTQ - Guatemalan Quetzal
GYD - Guyanese Dollar
HKD - Hong Kong Dollar
HNL - Honduran Lempira
HRK - Croatian Kuna
HTG - Haitian Gourde
HUF - Hungarian Forint
IDR - Indonesian Rupiah
ILS - Israeli Shekel
IMP - Isle of Man Pound
INR - Indian Rupee
IQD - Iraqi Dinar
IRR - Iranian Rial
ISK - Icelandic Krona
JEP - Jersey Pound
JMD - Jamaican Dollar
JOD - Jordanian Dinar
JPY - Japanese Yen
KES - Kenyan Shilling
KGS - Kyrgyzstani Som
KHR - Cambodian Riel
KMF - Comoran Franc
KPW - North Korean Won
KRW - South Korean Won
KWD - Kuwaiti Dinar
KYD - Caymanian Dollar
KZT - Kazakhstani Tenge
LAK - Lao or Laotian Kip
LBP - Lebanese Pound
LKR - Sri Lankan Rupee
LRD - Liberian Dollar
LSL - Basotho Loti
LTL - Lithuanian Litas
LVL - Latvian Lat
LYD - Libyan Dinar
MAD - Moroccan Dirham
MDL - Moldovan Leu
MGA - Malagasy Ariary
MKD - Macedonian Denar
MMK - Burmese Kyat
MNT - Mongolian Tughrik
MOP - Macau Pataca
MRO - Mauritanian Ouguiya
MUR - Mauritian Rupee
MVR - Maldivian Rufiyaa
MWK - Malawian Kwacha
MXN - Mexican Peso
MYR - Malaysian Ringgit
MZN - Mozambican Metical
NAD - Namibian Dollar
NGN - Nigerian Naira
NIO - Nicaraguan Cordoba
NOK - Norwegian Krone
NPR - Nepalese Rupee
NZD - New Zealand Dollar
OMR - Omani Rial
PAB - Panamanian Balboa
PEN - Peruvian Nuevo Sol
PGK - Papua New Guinean Kina
PHP - Philippine Peso
PKR - Pakistani Rupee
PLN - Polish Zloty
PYG - Paraguayan Guarani
QAR - Qatari Riyal
RON - Romanian New Leu
RSD - Serbian Dinar
RUB - Russian Ruble
RWF - Rwandan Franc
SAR - Saudi or Saudi Arabian Riyal
SBD - Solomon Islander Dollar
SCR - Seychellois Rupee
SDG - Sudanese Pound
SEK - Swedish Krona
SHP - Saint Helenian Pound
SLL - Sierra Leonean Leone
SOS - Somali Shilling
SPL - Seborgan Luigino
SRD - Surinamese Dollar
STD - Sao Tomean Dobra
SVC - Salvadoran Colon
SYP - Syrian Pound
SZL - Swazi Lilangeni
THB - Thai Baht
TJS - Tajikistani Somoni
TMT - Turkmenistani Manat
TND - Tunisian Dinar
TOP - Tongan Pa'anga
TRY - Turkish Lira
TTD - Trinidadian Dollar
TVD - Tuvaluan Dollar
TWD - Taiwan New Dollar
TZS - Tanzanian Shilling
UAH - Ukrainian Hryvna
UGX - Ugandan Shilling
USD - US Dollar
UYU - Uruguayan Peso
UZS - Uzbekistani Som
VEF - Venezuelan Bolivar Fuerte
VND - Vietnamese Dong
VUV - Ni-Vanuatu Vatu
WST - Samoan Tala
XAF - Central African CFA Franc BEAC
XAG - Silver Ounce
XAU - Gold Ounce
XCD - East Caribbean Dollar
XDR - IMF Special Drawing Rights
XOF - CFA Franc
XPD - Palladium Ounce
XPF - CFP Franc
XPT - Platinum Ounce
YER - Yemeni Rial
ZAR - South African Rand
ZMK - Zambian Kwacha
ZWD - Zimbabwean Dollar
[*] My project->Settings->Da and a requirement value and type are string

B. Codes

1. Imports:
Imports System.Text.RegularExpressions
2. Privat Functions and custom Subs :
Private Function GetBetween(ByVal input As String, ByVal str1 As String, ByVal str2 As String, ByVal index As Integer) As String
Try
Dim temp As String = Regex.Split(input, str1)(index + 1)
Return Regex.Split(temp, str2)(0)
Catch
MsgBox("Fatal Error, please, contact Gr0wlit for more informations")
End Try
End Function

Sub Grab()
CheckForIllegalCrossThreadCalls = False
Dim wc As New System.Net.WebClient
Dim source As String = wc.DownloadString("http://www.xe.com/ucc/convert/?Amount=" & TextBox1.Text & "&From=" & From & "&To=" & T)

Dim Result As String = GetBetween(source, "<td width=""47%"" align=""left"">", "<span class=""uccResCde"">", 0).Split("&")(0)
TextBox2.Text = Result
End Sub
3. Double click on Combobox1 and copy-paste code:
From = ComboBox1.SelectedIndex.ToString
From = ComboBox1.Items(From).ToString.Substring(0, 3)
If Not ComboBox2.Text = "" Then
If IsNumeric(TextBox1.Text) Then
Label5.Text = ""
thread1 = New System.Threading.Thread(AddressOf Grab)
thread1.Start()
End If
End If
4. Double click on Combobox2 and copy-paste code:
T = ComboBox2.SelectedIndex.ToString
T = ComboBox2.Items(T).ToString.Substring(0, 3)
If Not ComboBox1.Text = "" Then
If IsNumeric(TextBox1.Text) Then
Label5.Text = ""
thread1 = New System.Threading.Thread(AddressOf Grab)
thread1.Start()
End If
End If
5. Double click on Textbox1 and copy-paste code:
If Not ComboBox2.Text = "" And Not ComboBox1.Text = "" Then
If IsNumeric(TextBox1.Text) Then
Label5.Text = ""
thread1 = New System.Threading.Thread(AddressOf Grab)
thread1.Start()
End If
End If
6. Double click on Textbox2 and copy-paste code:
Try
Clipboard.SetText(TextBox2.Text)
Label5.Text = "Text copied!"
Catch ex As Exception
MsgBox("No currency selected!", MsgBoxStyle.Exclamation)
End Try
6. Double click on Form1 and select FormClosing and copy-paste code:
My.Settings.Da = ComboBox1.SelectedIndex
My.Settings.a = ComboBox2.SelectedIndex
7. Double click on Form1 and copy-paste code:
Try
ComboBox1.SelectedIndex = My.Settings.Da
ComboBox2.SelectedIndex = My.Settings.a
Catch ex As Exception

End Try
Good luck. :D
You do not have the required permissions to view the files attached to this post.
Last edited by MrAlicard on Sun Jul 01, 2012 11:57 pm, edited 1 time in total.
User avatar
pip
VIP - Donator
VIP - Donator
Posts: 156
Joined: Tue Jul 12, 2011 3:13 am

Re: Currency Converter
pip
Meh this looks like one on youtube + i think the credit thing is set to high sorry :) other than that thanks for sharing this may be useful for some people good job though!
Edit: i like the background look and the way it is setup that is very nice!
+rep
<a href="http://www.points2shop.com/s/xbox_point ... 5082"><img src="http://points2shop.com/images/promotion ... ricoxg.gif" border="0"/></a>
User avatar
MrAlicard
VIP - Donator
VIP - Donator
Posts: 54
Joined: Thu Aug 05, 2010 4:08 pm

Re: Currency Converter
MrAlicard
Is now four credit. :P
User avatar
Shim
VIP - Donator
VIP - Donator
Posts: 882
Joined: Wed Dec 14, 2011 5:02 am

Re: Currency Converter
Shim
looks great ! Great job !
Find my programs on Softpedia
User avatar
ramin
Just Registered
Just Registered
Posts: 1
Joined: Fri Jul 26, 2013 7:09 am

Re: Currency Converter
ramin
not working buddy
two veriables not declear


From = ComboBox1.SelectedIndex.ToString
From = ComboBox1.Items(From).ToString.Substring(0, 3)
If Not ComboBox2.Text = "" Then
If IsNumeric(TextBox1.Text) Then
Label5.Text = ""
thread1 = New System.Threading.Thread(AddressOf Grab)
thread1.Start()
End If
End If



T = ComboBox2.SelectedIndex.ToString
T = ComboBox2.Items(T).ToString.Substring(0, 3)
If Not ComboBox1.Text = "" Then
If IsNumeric(TextBox1.Text) Then
Label5.Text = ""
thread1 = New System.Threading.Thread(AddressOf Grab)
thread1.Start()
End If
End If
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

Re: Currency Converter
Dummy1912
nice done :)
+rep
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
User avatar
dualz
VIP - Donator
VIP - Donator
Posts: 29
Joined: Mon Jul 15, 2013 9:47 pm

Re: Currency Converter
dualz
goold old data scraping, has its perks :d, but also bear in mind that if you dont use floats or doubles it may pull back an error when converting the output values.

also bear in pind that if you use data sraping based applications, and you happen to be behind a proxy server, the data wont be transmitted or recieved unless you delare the proxy settings

the standard programming practice, only use strings when needed, use doubles or floats for decimal placing, use ints for single values or my favorite use arrays for everything.

but overall nice program, it will indeed be usefull for some starters into programming.
Dualz
Co-Owner TADStools Network
  • Microsoft Systems Engineer
    Microsoft Software Engineer
    Cisco Certified Network Engineer
    Programming Languages: Delphi, Python, Cron, PHP, HTML, ASP.Net, Cold Fustion, VB.net, C, C++, C#, XAML, IOS, Android, Java, ASM
7 posts Page 1 of 1
Return to “Tutorials”