hi.
i am developing a simple vb.net application. i have three forms in my app. the first form has 2 radio buttons from which i need to select one. based on the selection made in my next form a combobox ll be populated.so far so good.there is a back button on my 2nd form which when clicked redirects me to the first form. here when i select the next radio button the combo box in the next form does not populate accordingly. it still holds the old values.
i hope my question is clear.
this is the code i have in the first form.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm As Form2
frm = New Form2()
If RadioButton1.Checked Then
passedtext = RadioButton1.Text
ElseIf RadioButton2.Checked Then
passedtext = RadioButton2.Text
End If
Me.Hide()
frm.Show()
End Sub
this is the code i have in the second form
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
selectionstr = Form1.passedtext
If String.Compare(selectionstr, "UNDER GRADUATE", True) = 0 Then
'Dim obj As New Form1
'obj.passedtext = Form1.RadioButton1.Text
'If Form1.RadioButton1.Checked Then
ComboBox1.Items.Clear()
ComboBox1.Items.AddRange(New String() {"op1","op2"})
ElseIf String.Compare(selectionstr, "POST GRADUATE", True) = 0 Then
'ElseIf Form1.RadioButton2.Checked Then
ComboBox1.Items.Clear()
ComboBox1.Items.AddRange(New String() {"opt1","opt2"})
End If
End Sub