我正在尝试在textbox&中输入值我想转换为整数。我正在使用VBA 2013。
我尝试了多种方式,但我一直都在接受预期
Rated_current = CInt(Int(TextBox_RatedCurrent.Text))
Rated_current = CInt(TextBox_RatedCurrent.Text)
Rated_current = Convert.toInt32(TextBox_RatedCurrent.Text)
Private Sub TextBox_Bmax_TextChanged(sender As Object, e As EventArgs) Handles TextBox_Bmax.TextChanged
Rated_current = CInt(Int(TextBox_RatedCurrent.Text))
Mod_current = TextBox_RatedCurrent.Text * TextBox_TotalDrate.Text
Calculated_TempRise.Text = CInt(Max_temp / ((Log10(Mod_current) / Log10(Rated_current)) * 1.64))
End Sub
答案 0 :(得分:0)
int Rated_current;
bool check = int.tryParse(TextBox_RatedCurrent.Text,out Rated_current);
if(!check)
{
//Incoming value is wrong
}