This is my first time trying to serialize something. I'm getting an error that says:
Type 'System.Windows.Forms.Form' in Assembly 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.
The class is marked serializable, so I'm unsure what this is telling me.
Type 'System.Windows.Forms.Form' in Assembly 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.
The class is marked serializable, so I'm unsure what this is telling me.
VB.NET:
Sub SaveGame()
Dim serTexas As New ArrayList
Dim GameInfo As New frmMain
GameInfo.intPlayers = intPlayers
GameInfo.DealCards = DealCards
GameInfo.lstP1 = lstP1
GameInfo.chkP1 = chkP1
GameInfo.lstP2 = lstP2
GameInfo.chkP2 = chkP2
GameInfo.lblTurn = lblTurn
GameInfo.lstRiver = lstRiver
GameInfo.lblRiver = lblRiver
GameInfo.intCardNo = intCardNo
GameInfo.intRound = intRound
serTexas.Add(GameInfo)
Dim s As New FileStream("c:\SavedGame.dat", FileMode.Create)
Dim f As New BinaryFormatter
[COLOR=red]f.Serialize(s, serTexas) 'Error points to this line[/COLOR]
s.Close()
End Sub