我想用VB.NET简单计算在VB.Net
计算雷诺数这是我的代码:
Public Class Form1
Dim vis As Integer
Dim Den As Integer
Dim hd As Integer
Dim vl As Integer
Dim re As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
vis = Int(TextBox1.Text)
Den = Int(TextBox2.Text)
hd = Int(TextBox4.Text)
vl = Int(TextBox5.Text)
re = (Den * vl * hd)/vl
TextBox3.Show(re)
End Sub
End Class
见我的UI here。
为什么我仍然收到错误信息“太多的论据”?
如果要将're'发布到文本框,它是'TextBox3.Text = re.ToString()'。你应该打开Option Strict,但是 - (Den * v1 * hd)/ vl'的结果将是Double,而不是整数 – Plutonix
如果我是正确的,那**不是如何计算雷诺数**。在尝试此操作之前,我会首先查看更多*** https://en.wikipedia.org/wiki/Reynolds_number*** ... – Codexer
顺便说一句,'.Show()'只是将.Visible属性设置为true。 – Plutonix