在消息框中收到此消息,我正在使用MetroFramework尝试显示消息框但是我收到此错误(CS1503)。
while (true)
{
try
{
Var.borrowAmountNumber = int.Parse(borrowAmount);
Var.loanLengthNumber = int.Parse(loanLength);
Var.interestRateNumber = float.Parse(interestRate);
Var.i = true;
break;
}
catch (Exception)
{
MetroMessageBox.Show(this, "Please enter a integer.","Error", MessageBoxButtons.OK, MessageBoxIcon.Warning,100);
break;
}
}
答案 0 :(得分:0)
修正:
替换:
MetroMessageBox.Show(this, "Please enter a integer.","Error", MessageBoxButtons.OK, MessageBoxIcon.Warning,100);
使用:
MetroMessageBox.Show(Form.ActiveForm, "Please enter a integer.","Error", MessageBoxButtons.OK, MessageBoxIcon.Warning,100);
这解决了这个问题。