Inserting a € symbol into a textbox in windows from?.
Hiya folks i can put a £ symbol into the line but im not sure on the € sign?..can anyone help me please? I used "C" for sterling price but what do i use for the euro?
txtFinEuros.Text = (Convert.ToDecimal(txtBoxBrick.Text) * Convert.ToDecimal(textBoxLength.Text) * Convert.ToDecimal(txtEuros.Text)* Convert.ToDecimal(textBoxWidth.Text)).ToString("C");
Re: Inserting a € symbol into a textbox in windows from?.
Maybe a silly idea, but surely the easiest would be to insert € symbol in the Textbox during design time ( in its Text property press Alt + 0128 ) then do something like :
Code:
txtFinEuros.Text += (Convert.ToDecimal(txtBoxBrick.Text) * Convert.ToDecimal(textBoxLength.Text) * Convert.ToDecimal(txtEuros.Text)* Convert.ToDecimal(textBoxWidth.Text));
But it is strange though, if you have set up your PC's Regional settings properly to show Euros as a Currency symbol, this would not have been an issue, then you could have just done this :
Code:
txtFinEuros.Text = (Convert.ToDecimal(txtBoxBrick.Text) * Convert.ToDecimal(textBoxLength.Text) * Convert.ToDecimal(txtEuros.Text)* Convert.ToDecimal(textBoxWidth.Text)).ToString("C");
Do some research on Globalization in C#
Re: Inserting a € symbol into a textbox in windows from?.
still not working..im getting:
'Input string was not in a correct format.'
Re: Inserting a € symbol into a textbox in windows from?.
This is the code ive been working on..tried everything but to no use?..
//euros calculation
txtFinEuros.Text = "€";
txtFinEuros.Text = (Convert.ToDecimal(txtBoxBrick.Text) * Convert.ToDecimal(textBoxLength.Text) * Convert.ToDecimal(txtEuros.Text) * Convert.ToDecimal(textBoxWidth.Text)).ToString("F");
Re: Inserting a € symbol into a textbox in windows from?.
I thought you'd have figured out by now that because we are adding the € sign manually, it gest seen as a string, and therefore cannot be used in calculations. I'd suggest usinag a variable o store the calculation, then, add the € and the variable in the textbox. :rolleyes:
Re: Inserting a € symbol into a textbox in windows from?.
You are replacint content of the txtFinEuros. Swap the steps and append:
Code:
txtFinEuros.Text = (Convert.ToDecimal(txtBoxBrick.Text) * Convert.ToDecimal(textBoxLength.Text) * Convert.ToDecimal(txtEuros.Text) * Convert.ToDecimal(textBoxWidth.Text)).ToString("F");
txtFinEuros.Text = txtFinEuros.Text + "€";