This is a follow-up on an earlier post; I awarded the points before testing the code, as it seemed quite straight forward.
As per (http://experts-exchange.com/Programming/Q_21399992.html
), I am "simply" trying to determine whether a checkbox has been selected in arraylist. If so, I need to transfer that information to a new arraylist.
When I invoke the suggested code in my VB.NET program, I receive the following error:
An unhandled exception of type 'System.InvalidCastExcepti
on' occurred in program1.exe
Additional information: Specified cast is not valid.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cb As CheckBox
For Each cb In g_ListofOptions
If cb.Checked Then
MsgBox(cb.Name & " checked")
The checkboxes are added to the global arraylist, g_ListofOptions in the following manner:
and subsequently, manually selected by the user.
Will someone kindly point me to the error in my code/ways; I have spent much too much time on this problem, and alas, I am finding myself waxing nostalgic for a simplier time, and FORTRAN!