I get an error on
Description is "Exception has been thrown by the target of an invocation."Code:Private Class ControlInfo Public ControlType As Type Public Properties As New Dictionary(Of String, Object) Sub New(ByVal ctrl As Control) ControlType = ctrl.GetType Dim value As Object For Each pi As Reflection.PropertyInfo In ControlType.GetProperties If pi.CanWrite Then ----------->>>>> value = pi.GetValue(ctrl, Nothing) If value Is Nothing OrElse value.GetType.IsSerializable Then Properties.Add(pi.Name, value) End If End If Next End Sub End Class
when I try to apply
on my form closed event...Code:Dim fs As New IO.FileStream("c:\layout.bin", IO.FileMode.Create) LayoutSerializer.SaveLayout(Me, fs) fs.Close()




Reply With Quote