Hi
There are two missing things in the project. Im already done devloping the first missing thing.
Now Basically heres what i want to do:
1-Select the Material Name from the Combo Box
2-(Build an If statement; for instanse if the mild steel is selected and the Feed tooth is 0.3 then my value(KC) would be 1820.
3-When the Calculate Button Is hit this is what i want to happen, The Gearsafety.value = (declared variable) where the declared variable would be a mathematical Equation. Example
Dim Calculate as Double
Calculate = Tool Diamater * Depth of Cut * vf * KC ; where the KC is 1820.
Now continuing the previous code:
If calcualte < GearMaxpower.value then
Gearsafety.value= "safe"
ele
Gearsafety.value "unsafe"
Now my Question is how would i build an if statement for the combo box for all the materials.
I think its :
If item1.value = true & GearFeedPerTooth=0.1 Then KC = 2200 else if item1.value = true & GearFeedPerTooth=0.2 Then KC = 1950...................................
Then Item2.value = true.....................................
Then Item 3.........
May you kindly tell me the exact code regarding the selection of the combo box items ? and an easier procedure if available ?
Also If I set the control ’ s Sorted property to True , the ComboBox lists its choices in sorted order , will that affect the coding and result in error values ?
Heres my attempt:
I disabled the last 4 lines to see what value fo i get but it keeps giving me a zero.
There are two missing things in the project. Im already done devloping the first missing thing.
Now Basically heres what i want to do:

1-Select the Material Name from the Combo Box
2-(Build an If statement; for instanse if the mild steel is selected and the Feed tooth is 0.3 then my value(KC) would be 1820.
3-When the Calculate Button Is hit this is what i want to happen, The Gearsafety.value = (declared variable) where the declared variable would be a mathematical Equation. Example
Dim Calculate as Double
Calculate = Tool Diamater * Depth of Cut * vf * KC ; where the KC is 1820.

Now continuing the previous code:
If calcualte < GearMaxpower.value then
Gearsafety.value= "safe"
ele
Gearsafety.value "unsafe"
Now my Question is how would i build an if statement for the combo box for all the materials.
I think its :
If item1.value = true & GearFeedPerTooth=0.1 Then KC = 2200 else if item1.value = true & GearFeedPerTooth=0.2 Then KC = 1950...................................
Then Item2.value = true.....................................
Then Item 3.........
May you kindly tell me the exact code regarding the selection of the combo box items ? and an easier procedure if available ?
Also If I set the control ’ s Sorted property to True , the ComboBox lists its choices in sorted order , will that affect the coding and result in error values ?
Heres my attempt:
Private
Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim x, y, z As Double
Dim x, y, z As Double
x = (ToolDiameter * (Math.PI) * GearSpindleSpeed.Value) / 1000
GearVc.Text = x
y = GearFeedPerTooth.Value * GearTeethCutter.Value * GearSpindleSpeed.Value
GearVf.Text = y
z = (y * GearDepthCutZ.Value * ToolDiameter) / 1000
GearMrr.Text = z
GearVc.Text = x
y = GearFeedPerTooth.Value * GearTeethCutter.Value * GearSpindleSpeed.Value
GearVf.Text = y
z = (y * GearDepthCutZ.Value * ToolDiameter) / 1000
GearMrr.Text = z
Dim KC, Calculate As Double
If GearMaterialSelection.SelectedItem = "Mild steel" & GearFeedPerTooth.Value = 0.1 Then
KC = 2200
ElseIf GearMaterialSelection.SelectedItem = "Mild steel" & GearFeedPerTooth.Value = 0.2 Then
KC = 1950
ElseIf GearMaterialSelection.SelectedItem = "Mild steel" & GearFeedPerTooth.Value = 0.3 Then
KC = 1820
ElseIf GearMaterialSelection.SelectedItem = "Mild steel" & GearFeedPerTooth.Value = 0.4 Then
KC = 1700
ElseIf GearMaterialSelection.SelectedItem = "Mild steel" & GearFeedPerTooth.Value = 0.6 Then
KC = 1580
End If
Calculate = (ToolDiameter * GearDepthCutZ.Value * y * KC) / (1000000 * 60 * 0.9)
GearSafety.Text = Calculate
GearSafety.Text = Calculate
'If Calculate < GearmaxPower.Value Then
'GearSafety.Text = "Safe"
'Else
'GearSafety.Text = "UnSafe"
'End If
End Sub
I disabled the last 4 lines to see what value fo i get but it keeps giving me a zero.