Hi,
I'm a beginner to VB and started using visual Studio 2013 just 2 days ago (I have some experience but this is with writing post processors for CNC machines using different languages) so please go easy on me.
I am creating an engineering calculator, the user inputs a few values and hits the calculate button to work out two variables. Now I am wanting the calculation to work both ways depending on what variables are know by the user but I cant seem to get it to do both currently. This is where I am at currently;
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
rev.Text = (Val(ssf.Text) * 1000) / (3.14159 * Val(tool.Text))
fe.Text = Val(rev.Text) * Val(fpt.Text)
ssf.Text = (Val(rev.Text) * 3.14159 * Val(tool.Text)) / 1000
fpt.Text = Val(fe.Text) / Val(rev.Text)
rev.Text = FormatNumber(rev.Text, 0)
fe.Text = FormatNumber(fe.Text, 0)
ssf.Text = FormatNumber(ssf.Text, 0)
fpt.Text = FormatNumber(fpt.Text, 2)
End Sub
I basically want it to either perform the red text or the blue text calculations depending on what text boxes are filled in with information.
Also is there anyway for the calculation to automatically calculate with out the use of a button? so it constantly refreshes/ updates.
Sorry if this is a bit of a basic question, I am only just starting to get into it.
Any advice would be much appreciated.
Regards
Mat
I'm a beginner to VB and started using visual Studio 2013 just 2 days ago (I have some experience but this is with writing post processors for CNC machines using different languages) so please go easy on me.
I am creating an engineering calculator, the user inputs a few values and hits the calculate button to work out two variables. Now I am wanting the calculation to work both ways depending on what variables are know by the user but I cant seem to get it to do both currently. This is where I am at currently;
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
rev.Text = (Val(ssf.Text) * 1000) / (3.14159 * Val(tool.Text))
fe.Text = Val(rev.Text) * Val(fpt.Text)
ssf.Text = (Val(rev.Text) * 3.14159 * Val(tool.Text)) / 1000
fpt.Text = Val(fe.Text) / Val(rev.Text)
rev.Text = FormatNumber(rev.Text, 0)
fe.Text = FormatNumber(fe.Text, 0)
ssf.Text = FormatNumber(ssf.Text, 0)
fpt.Text = FormatNumber(fpt.Text, 2)
End Sub
I basically want it to either perform the red text or the blue text calculations depending on what text boxes are filled in with information.
Also is there anyway for the calculation to automatically calculate with out the use of a button? so it constantly refreshes/ updates.
Sorry if this is a bit of a basic question, I am only just starting to get into it.
Any advice would be much appreciated.
Regards
Mat