"Rich" <Ri**@discussions.microsoft.comschrieb:
Is it possible to assign a value to a groupbox by selecting a radiobutton
contained in the groupbox?
Say you assign a value of 1 to radbtn1, 2 for radbtn2, 3 for radbtn3 all
contained in grpBox. You click radbtn1.
Console.writeline(grpBox.Value.ToString)
Is there a way to do something like this? (VB2005)
Add a common event handler to all the radio buttons which belong to a group:
\\\
Private m_Group1SelectedRadioButton As RadioButton
Private Sub RadioButtonGroup1_CheckedChanged( _
ByVal sender As Object, _
ByVal e As EventArgs _
) Handles _
RadioButton1.CheckedChanged, _
RadioButton2.CheckedChanged, _
RadioButton3.CheckedChanged
Dim SourceControl As RadioButton = DirectCast(sender, RadioButton)
If SourceControl.Checked Then
m_Group1SelectedRadioButton = SourceControl
End If
End Sub
///
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>