The aim is to get the properties of the Form and the controls in it and save it to a
string
called
frmstring
.
Dim frmstring as String
Dim frm As Assembly = Assembly.LoadFile(Application.ExecutablePath)
For Each s As Type In frm.GetTypes
frmstring = frmstring & frm.GetName.FullName
For Each m As PropertyInfo In s.GetProperties
Try
frmstring = frmstring & (m.Name & " : " & m.GetValue(Me, Nothing)) & vbCrLf
Catch ex As Exception
End Try
Next
frmstring = frmstring & "------------------------" & vbCrLf
Next
For Each ctrl As Control In Me.Controls
frmstring = frmstring & ctrl.Name & vbCrLf
Dim z = ctrl.GetType()
For Each n As PropertyInfo In z.GetProperties
Try
frmstring = frmstring & (n.Name) & " : " & n.GetValue(ctrl, Nothing).ToString & vbCrLf
Catch ex As Exception
End Try
Next
Next