How do I put the results of numerous formulas into one text box? It has to be in a format using "XYZ"'s in the cartesian coordinate system. X__ Y __ Z__
Printable View
How do I put the results of numerous formulas into one text box? It has to be in a format using "XYZ"'s in the cartesian coordinate system. X__ Y __ Z__
Uh, textboxname.Text = "whatever you want"? Or do I misunderstand the problem?
Im assuming you have the results stored in variables if so you could simply do this
VB Code:
Public Function fillText(x As Integer, y As Integer, Z As Integer) If Len(text1.Text) = 0 then Text1.Text = x & ", " & y & ", " & z else Text1.text = Text1.text & " - " & x & ", " & y & ", " & z end if End Function 'call the function like this fillText 12,14,16 'The number values could also be any variables you are using
Hope that was close to what you were wanting to do
Ps by using it in a function you can simply call the function from whatever routine yuo have that is collecting the values also allows you to call it from other routines to update the data
:)
Please specify what you want to do.
I'm sorry, I should have been more specific. Out put is simple, I am having trouble with a multiple line format. If that makes any sense.
t = txtdia.Text
p = txtpitch.Text
z = txtflutes.Text
f = txtchipload.Text
v = txtSFM.Text
cl = txtclearance.Text
n = (v * 12) / (pi * t)
f1 = f * z * n
f2 = f1 * (Major - t) / Major
ri = Minor / 2
ro = Major / 2
re = ((ri - cl) ^ 2 + ro ^ 2) / (2 * ro)
D = 20 / Major / p
a = pi * Major / 4
r = a * (Tan(D * (pi / 180)))
p1 = 1 / p
X = 0
Y = (-ri) + cl
'txtprogram = N10 G90 G0 X Y Z
'G91 G41 D? X Y -0.578250 Z
' G3 X 0.625000 Y 0.579998 Z
' G3 X Y Z
' G3 X -0.625000 Y 0.579998 Z 0.014569 R 0.579998
' G0 G40 X Y -0.578250 Z
' M1
anyhow, I hope you get the Idea. The lines had to be cut short for this. I also have to be able to cut and paste into word with only single spaces between.
If you want to make multiple lines in a textbox, change its multiline property to True and end lines with vbCrlLf, like this:
VB Code:
Const toDisplay As String = "Line 1" & vbCrLf & "Second Line"
I'm sorry, but I still don't understand. I am new at this.
Now I get it. Thank you!
:cool:
this is what I have now. On the line starting with G91. I want the answer to an equation after the D with no space.
txtprogram.text = "N10 G90 G0 X0 Y0 Z0" & vbCrLf & "G91 G41 D"
to get that just put this
VB Code:
txtprogram.text = "N10 G90 G0 X0 Y0 Z0" & vbCrLf & "G91 G41 D" txtprogram.text = txtprogram.text & youranswerhere
txtprogram.Text = "N10 G90 G0 X0 Y0 Z0" & vbCrLf & "G91 G41 D? X0 Y? Z0" & vbCrLf & "G3 X? Y? Z? R? S? F?" & vbCrLf & "G3 X0 Y0 Z? I? J0" & vbCrLf & "G3 X? Y? Z? R?" & vbCrLf & "G0 G40 X0 Y? Z0" & vbCrLf & "M1"
txtprogram.Text = txtprogram.text& txtdvalue.Text
Like this? I have to put an answer to a formula at every question mark.
By doing that, the M1 turns into M15
that is if the answer for txtdvalue.text is 5
it seems i just have to " " & txtdvalue & " "
thats correct
SOrry I thought you just had the 1 line that you used in your example