SoPathetic
New member
I have this code:
Private Sub btnSummary_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSummary.Click
For Each element As RadioButton In grpCPU.Controls
If (element.Checked = True) Then
Me.lstDisplay.Items.Add(element.Text)
End If
Next
For Each element As RadioButton In grpOS.Controls ' I GET ERROR HERE.
If (element.Checked = True) Then
Me.lstDisplay.Items.Add(element.Text)
End If
Next
and the error is: Unable to cast object of type 'System.Windows.Forms.TextBox' to type 'System.Windows.Forms.RadioButton'.
that is because i used two controls in the grpOs. How do i fix this problem?
Please help me. Thanks in advance!
Private Sub btnSummary_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSummary.Click
For Each element As RadioButton In grpCPU.Controls
If (element.Checked = True) Then
Me.lstDisplay.Items.Add(element.Text)
End If
Next
For Each element As RadioButton In grpOS.Controls ' I GET ERROR HERE.
If (element.Checked = True) Then
Me.lstDisplay.Items.Add(element.Text)
End If
Next
and the error is: Unable to cast object of type 'System.Windows.Forms.TextBox' to type 'System.Windows.Forms.RadioButton'.
that is because i used two controls in the grpOs. How do i fix this problem?
Please help me. Thanks in advance!