Please I need help! I have already spent about 7 hours working on this part of program. I have Items in a combo box ("Cardiac Angiography, Chest Room, Fluroscopy Tube (R&F room), Mammography Room, Peripheral Angiography ,Rad Room (all barriers), Rad Room (chest bucky),Rad Room (floor or other barriers), Rad Tube (R&F room)") that when an item is selected, a value assigned to the item is displayed in a text box. Now, I have radio buttons (Lead, Concrete, Gypsum Wallboard) that I want to link to the combo box so that when a radio button is active, it will link with the assigned value for item selected in the combo box and that value will be displayed in the text box. Below is the code:
Code:
Public Sub Rad_lead_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Rad_lead.CheckedChanged
'Lead Fitting parameters for transmission of broad primary x-ray
Dim radroom_allbarriers_alpha As Double = 2.346, radroom_allbarriers_beta As Double = 15.9, radroom_allbarriers_gamma As Double = 0.4982
Dim radroom_chestbucky_alpha As Double = 2.264, radroom_chestbucky_beta As Double = 13.08, radroom_chestbucky_gamma As Double = 0.56
Dim radroom_floor_alpha As Double = 2.651, radroom_floor_beta As Double = 16.56, radroom_floor_gamma As Double = 0.4585
Dim fluoroscopy_tube_alpha As Double = 2.347, fluoroscopy_tube_beta As Double = 12.67, fluoroscopy_tube_gamma As Double = 0.6149
Dim radtube_alpha As Double = 2.295, radtube_beta As Double = 13.0, radtube_gamma As Double = 0.5573
Dim chestroom_alpha As Double = 2.283, chestroom_beta = 10.74, chestroom_gamma As Double = 0.637
Dim mammography_alpha As Double = 30.6, mammography_beta As Double = 177.6, mammography_gamma As Double = 0.3308
Dim cardiac_angiography_alpha As Double = 2.389, cardiac_angiography_beta As Double = 14.26, cardiac_angiography_gamma As Double = 0.5948
Dim peripheral_angiography_alpha As Double = 2.728, peripheral_angiography_beta As Double = 18.52, peripheral_angiography_gamma As Double = 0.4614
If Rad_lead.Checked = True Then
Select combo_fitting.Text
Case "Cardiac Angiography"
With txtalpha
.Text = cardiac_angiography_alpha.ToString()
End With
With txtbeta
.Text = cardiac_angiography_beta.ToString()
End With
With txtgamma
.Text = cardiac_angiography_gamma.ToString()
End With
Case "Chest Room"
With txtalpha
.Text = chestroom_alpha.ToString()
End With
With txtbeta
.Text = chestroom_beta.ToString()
End With
With txtgamma
.Text = chestroom_gamma.ToString()
End With
Case "Fluroscopy Tube (R&F room)"
With txtalpha
.Text = fluoroscopy_tube_alpha.ToString()
End With
With txtbeta
.Text = fluoroscopy_tube_beta.ToString()
End With
With txtgamma
.Text = fluoroscopy_tube_gamma.ToString()
End With
Case "Mammography Room"
With txtalpha
.Text = mammography_alpha.ToString()
End With
With txtbeta
.Text = mammography_beta.ToString()
End With
With txtgamma
.Text = mammography_gamma.ToString()
End With
Case " Peripheral(Angiography)"
With txtalpha
.Text = peripheral_angiography_alpha.ToString()
End With
With txtbeta
.Text = peripheral_angiography_beta.ToString()
End With
With txtgamma
.Text = peripheral_angiography_gamma.ToString()
End With
Case " Rad Room (all barriers)"
With txtalpha
.Text = radroom_allbarriers_alpha.ToString()
End With
With txtbeta
.Text = radroom_allbarriers_beta.ToString()
End With
With txtgamma
.Text = radroom_allbarriers_gamma.ToString()
End With
Case "Rad Room (chest bucky)"
With txtalpha
.Text = radroom_chestbucky_alpha.ToString()
End With
With txtbeta
.Text = radroom_chestbucky_beta.ToString()
End With
With txtgamma
.Text = radroom_chestbucky_gamma.ToString()
End With
Case "Rad Room (floor or other barriers)"
With txtalpha
.Text = radroom_floor_alpha.ToString()
End With
With txtbeta
.Text = radroom_floor_beta.ToString()
End With
With txtgamma
.Text = radroom_floor_gamma.ToString()
End With
Case "Rad Tube (R&F room)"
With txtalpha
.Text = radtube_alpha.ToString()
End With
With txtbeta
.Text = radtube_beta.ToString()
End With
With txtgamma
.Text = radtube_gamma.ToString()
End With
End Select
End If
Exit sub
End Sub
Private Sub Rad_concrete_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Rad_concrete.CheckedChanged
'Concrete Fitting parameters for transmission of broad primary x-ray
'each variable was prefixed C to indicate concrete
Dim Cradroom_allbarriers_alpha As Double = 0.03626, Cradroom_allbarriers_beta As Double = 0.1429, Cradroom_allbarriers_gamma As Double = 0.4932
Dim Cradroom_chestbucky_alpha As Double = 0.03552, Cradroom_chestbucky_beta As Double = 0.1177, Cradroom_chestbucky_gamma As Double = 0.6007
Dim Cradroom_floor_alpha As Double = 0.03994, Cradroom_floor_beta As Double = 0.1448, Cradroom_floor_gamma As Double = 0.4231
Dim Cfluoroscopy_tube_alpha As Double = 0.03616, Cfluoroscopy_tube_beta As Double = 0.09721, Cfluoroscopy_tube_gamma As Double = 0.5186
Dim Cradtube_alpha As Double = 0.03549, Cradtube_beta As Double = 0.1164, Cradtube_gamma As Double = 0.5774
Dim Cchestroom_alpha As Double = 0.03622, Cchestroom_beta = 0.07766, Cchestroom_gamma As Double = 0.5404
Dim Cmammography_alpha As Double = 0.2577, Cmammography_beta As Double = 1.765, Cmammography_gamma As Double = 0.3644
Dim Ccardiac_angiography_alpha As Double = 0.03717, Ccardiac_angiography_beta As Double = 0.1087, Ccardiac_angiography_gamma As Double = 0.4879
Dim Cperipheral_angiography_alpha As Double = 0.04292, Cperipheral_angiography_beta As Double = 0.1538, Cperipheral_angiography_gamma As Double = 0.4236
If Rad_concrete.Checked = True Then
Select Case combo_fitting.Text
Case "Cardiac Angiography"
With txtalpha
.Text = Ccardiac_angiography_alpha.ToString()
End With
With txtbeta
.Text = Ccardiac_angiography_beta.ToString()
End With
With txtgamma
.Text = Ccardiac_angiography_gamma.ToString()
End With
Case "Chest Room"
With txtalpha
.Text = Cchestroom_alpha.ToString()
End With
With txtbeta
.Text = Cchestroom_beta.ToString()
End With
With txtgamma
.Text = Cchestroom_gamma.ToString()
End With
Case "Fluroscopy Tube (R&F room)"
With txtalpha
.Text = Cfluoroscopy_tube_alpha.ToString()
End With
With txtbeta
.Text = Cfluoroscopy_tube_beta.ToString()
End With
With txtgamma
.Text = Cfluoroscopy_tube_gamma.ToString()
End With
Case "Mammography Room"
With txtalpha
.Text = Cmammography_alpha.ToString()
End With
With txtbeta
.Text = Cmammography_beta.ToString()
End With
With txtgamma
.Text = Cmammography_gamma.ToString()
End With
Case "Peripheral Angiography"
With txtalpha
.Text = Cperipheral_angiography_alpha.ToString()
End With
With txtbeta
.Text = Cperipheral_angiography_beta.ToString()
End With
With txtgamma
.Text = Cperipheral_angiography_gamma.ToString()
End With
Case "Rad Room (all barriers)"
With txtalpha
.Text = Cradroom_allbarriers_alpha.ToString()
End With
With txtbeta
.Text = Cradroom_allbarriers_beta.ToString()
End With
With txtgamma
.Text = Cradroom_allbarriers_gamma.ToString()
End With
Case "Rad Room (chest bucky)"
With txtalpha
.Text = Cradroom_chestbucky_alpha.ToString()
End With
With txtbeta
.Text = Cradroom_chestbucky_beta.ToString()
End With
With txtgamma
.Text = Cradroom_chestbucky_gamma.ToString()
End With
Case "Rad Room (floor or other barriers)"
With txtalpha
.Text = Cradroom_floor_alpha.ToString()
End With
With txtbeta
.Text = Cradroom_floor_beta.ToString()
End With
With txtgamma
.Text = Cradroom_floor_gamma.ToString()
End With
Case "Rad Tube (R&F room)"
With txtalpha
.Text = Cradtube_alpha.ToString()
End With
With txtbeta
.Text = Cradtube_beta.ToString()
End With
With txtgamma
.Text = Cradtube_gamma.ToString()
End With
End Select
End If
Exit Sub
End Sub