この未処理の例外エラーが発生しています:
型 'System.Reflection.TargetInvocationException' の未処理の例外が PresentationFramework.dll で発生しました。
追加情報: 呼び出しのターゲットによって例外がスローされました。
これは私のコードです。これは、ユーザーがWPFで作成された +、-、/、x ボタンを押すと、一緒に新しい回答になる 2 つの TextBox の電卓です。
public partial class MainWindow : Window
{
public string numberInString
{
get { return TextDoos.Text; }
set { TextDoos.Text = value; }
}
public MainWindow()
{
if(TextDoos.Text == "")
{
if(TextDoos2.Text == "")
{
RekenFunctie(TextDoos.Text, TextDoos2.Text);
}
}
}
}
public int RekenFunctie(string numberInString, string numberInString)
{
int antwoord;
int getal = Convert.ToInt32(numberInString);
int getal2 = Convert.ToInt32(numberInString2);
if (Buttons.IsPressed) // This is the + button, there are also -,x,/ buttons.
{
antwoord = getal + getal2;
return antwoord;
}
}
なぜ機能しないのかわかりません...