Click here to Skip to main content
15,905,148 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
QuestionI get Input string was not in a correct format. error Pin
Søren Lyder Nielsen15-Apr-13 4:12
Søren Lyder Nielsen15-Apr-13 4:12 
I Get this error, when I write a number in my textBox1, and then erase it again.. Then this popup appers:

An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll
Additional information: Input string was not in a correct format.

Code:

C#
private: System::Void textBox1_TextChanged(System::Object^  sender, System::EventArgs^  e) {
             double tysk, ti, femten, tyve, dansk;
             tysk = System::Convert::ToDouble(textBox1->Text);
             
             dansk = tysk * 7.5;
             ti = tysk * 7.5 * 0.90;
             femten = tysk * 7.5 * 0.85;
             tyve = tysk * 7.5* 0.80;
             
             label7->Text = System::Convert::ToString(dansk);
             label8->Text = System::Convert::ToString(ti);
             label9->Text = System::Convert::ToString(femten);
             label10->Text = System::Convert::ToString(tyve);
         }
};


It also appers when I type a letter in the teksBox1.
Otherwise it workd fine.
Its just a simlpe calculator.
AnswerRe: I get Input string was not in a correct format. error Pin
Richard MacCutchan15-Apr-13 4:38
mveRichard MacCutchan15-Apr-13 4:38 
AnswerRe: I get Input string was not in a correct format. error Pin
eakteam16-Apr-13 23:35
professionaleakteam16-Apr-13 23:35 
AnswerRe: I get Input string was not in a correct format. error Pin
Member 1000269911-May-13 0:48
Member 1000269911-May-13 0:48 
QuestionC++ CLR Windows Form Application (Printing to the Printer) Pin
eakteam14-Apr-13 11:58
professionaleakteam14-Apr-13 11:58 
AnswerRe: C++ CLR Windows Form Application (Printing to the Printer) Pin
Richard MacCutchan14-Apr-13 20:59
mveRichard MacCutchan14-Apr-13 20:59 
GeneralRe: C++ CLR Windows Form Application (Printing to the Printer) Pin
eakteam14-Apr-13 23:59
professionaleakteam14-Apr-13 23:59 
GeneralRe: C++ CLR Windows Form Application (Printing to the Printer) Pin
Richard MacCutchan15-Apr-13 0:24
mveRichard MacCutchan15-Apr-13 0:24 
GeneralRe: C++ CLR Windows Form Application (Printing to the Printer) Pin
eakteam15-Apr-13 0:43
professionaleakteam15-Apr-13 0:43 
GeneralRe: C++ CLR Windows Form Application (Printing to the Printer) Pin
Richard MacCutchan15-Apr-13 1:06
mveRichard MacCutchan15-Apr-13 1:06 
GeneralRe: C++ CLR Windows Form Application (Printing to the Printer) Pin
eakteam15-Apr-13 1:33
professionaleakteam15-Apr-13 1:33 
GeneralRe: C++ CLR Windows Form Application (Printing to the Printer) Pin
Pete O'Hanlon15-Apr-13 3:38
mvePete O'Hanlon15-Apr-13 3:38 
GeneralRe: C++ CLR Windows Form Application (Printing to the Printer) Pin
eakteam15-Apr-13 6:00
professionaleakteam15-Apr-13 6:00 
GeneralRe: C++ CLR Windows Form Application (Printing to the Printer) Pin
kklim26-Aug-13 23:07
kklim26-Aug-13 23:07 
GeneralRe: C++ CLR Windows Form Application (Printing to the Printer) Pin
Richard MacCutchan27-Aug-13 3:47
mveRichard MacCutchan27-Aug-13 3:47 
GeneralRe: C++ CLR Windows Form Application (Printing to the Printer) Pin
kklim27-Aug-13 18:40
kklim27-Aug-13 18:40 
GeneralRe: C++ CLR Windows Form Application (Printing to the Printer) Pin
Richard MacCutchan27-Aug-13 20:51
mveRichard MacCutchan27-Aug-13 20:51 
GeneralRe: C++ CLR Windows Form Application (Printing to the Printer) Pin
kklim27-Aug-13 22:47
kklim27-Aug-13 22:47 
GeneralRe: C++ CLR Windows Form Application (Printing to the Printer) Pin
Richard MacCutchan27-Aug-13 22:55
mveRichard MacCutchan27-Aug-13 22:55 
GeneralRe: C++ CLR Windows Form Application (Printing to the Printer) Pin
kklim29-Aug-13 18:49
kklim29-Aug-13 18:49 
QuestionC++ and xaml connection to access database code Pin
juma owori10-Apr-13 23:34
juma owori10-Apr-13 23:34 
AnswerRe: C++ and xaml connection to access database code Pin
Richard MacCutchan11-Apr-13 0:48
mveRichard MacCutchan11-Apr-13 0:48 
Questionconversion from tchar* to string^ Pin
raghunath sahoo3-Apr-13 4:38
raghunath sahoo3-Apr-13 4:38 
AnswerRe: conversion from tchar* to string^ Pin
NotPolitcallyCorrect3-Apr-13 5:13
NotPolitcallyCorrect3-Apr-13 5:13 
AnswerRe: conversion from tchar* to string^ Pin
Richard MacCutchan3-Apr-13 5:13
mveRichard MacCutchan3-Apr-13 5:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.