【问题标题】:convert textbox data into integer将文本框数据转换为整数
【发布时间】:2015-09-22 05:40:48
【问题描述】:

我正在尝试在文本框中输入值,并且我想转换为整数。我正在使用 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

【问题讨论】:

    标签: visual-studio-2010 textbox typecasting-operator


    【解决方案1】:

    在 V2013 c# 中试试这个

    int Rated_current;
    bool check = int.tryParse(TextBox_RatedCurrent.Text,out Rated_current);
    if(!check)
    {
    
    //Incoming value is wrong
    
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-11-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-24
      • 1970-01-01
      相关资源
      最近更新 更多