我试图在txtMCQresult文本框中显示一个整数,该结果是在另一个文本框中完成的计算结果但无法找到方法。
Private Sub btnEnterMCQ_Click(sender As Object, e As EventArgs) Handles btnEnterMCQ.Click
txtMCQresult.Text = MidpointRounding(Integer.Parse(txtMCQ.Text) / 35 * 20)
txtMCQresult.Enabled = True
End Sub
答案 0 :(得分:1)
Private Sub btnEnterMCQ_Click(sender As Object, e As EventArgs) Handles btnEnterMCQ.Click
txtMCQresult.text = Math.Round((Integer.Parse(txtMCQ.Text) / 35 * 20), 1, MidpointRounding.ToEven)
txtMCQresult.Enabled = True
End Sub
答案 1 :(得分:0)
您可以使用
txtMCQresult.text = Math.Round(Convert.ToDecimal(xtMCQ.Text),2,MidpointRounding.ToEven);
答案 2 :(得分:0)
将Pramod的代码放在后面 如果txtMCQ.TEXT <36那么
txtMCQresult.Text =&#34; Pramod的代码&#34;