-1

I'm new with visual studio c#. I find no solution for next code.

int a = Convert.ToInt32(textEdit16.Text);


textEdit17.Text= Convert.ToString(a);

Error:

'Input string was not in a correct format.'

Timothy G.
  • 6,335
  • 7
  • 30
  • 46
Franco
  • 1
  • 1
  • Simply `a.ToString()` – Cyrille Con Morales Jun 13 '22 at 01:14
  • I already tried that and it doesn't work either. – Franco Jun 13 '22 at 01:20
  • _”I already tried that and it doesn't work either”_ … ? … Tried what and why doesn’t it work, does it throw an error? The posted code does not make a lot of sense. The error appears to be complaining about the line… `int a = Convert.ToInt32(textEdit16.Text);` … which would indicate that whatever TEXT is in … `textEdit16.Text` … that it is not a valid `int` “number.” Since it unclear what you are trying to do, you could do something like… `textEdit17.Text = textEdit16.Text;` … and accomplish the same thing without “converting” anything. Can you elaborate what you are trying to do? – JohnG Jun 13 '22 at 02:02

1 Answers1

0

Use debugging to view the value of textedit16. Text and set the textedit16. Text property to enter only numbers

Shunya
  • 2,344
  • 4
  • 16
  • 28