Hi All.. I have form1 as my main form, I have form2 as an alternate form that includes RadioButtons. To save my life, I cannot pass the radiobutton text to my Form1. This is how I have it set right now after many trials of different things. In Form1 the variable is always blank?
Form1: Click button on Form1 to open/show Form2 RadioButtons to make selection
Form2:
Form1: Click button on Form1 to open/show Form2 RadioButtons to make selection
Code:
Public Class Form1
Public rButtonSelect
Public Sub btnSubmit_Click(sender As Object, e As EventArgs) Handles btnSubmit.Click
rButtonSelect = Form2.rButton
Msgbox(rButtonSelect)
End Sub
Code:
Public Class Form2
Public Shared rButton As RadioButton
Public Sub btnSelect_Click(sender As Object, e As EventArgs) Handles btnSelect.Click
rButton = Panel1.Controls.OfType(Of RadioButton).FirstOrDefault(Function(r) r.Checked = True)
Me.Dispose()
End Sub