saving and loading controls

psolms

Member
Joined
Apr 23, 2008
Messages
14
Programming Experience
Beginner
hey everyone, i have a windows application.
i am using custom controls on a panel.
i need to be able to save and load all the information from all the controls.
what is the easiest way to do this?

thanks in advance.

psolms
 
sorry for the long wait, i had to take a bit of a break from this project for personal reasons. the statesaver is working great and im about to add the parts you mentioned. the question is where in the Sub New(ctl as Control) do i save it?
 
Anywhere you wish. I'd add first, last or between the others.
 
psolms said:
where in the Sub New(ctl as Control) do i save it?
JohnH said:
Anywhere you wish. I'd add first, last or between the others.
psolms said:
is it in the statesaver class? and if so where do you mean?
JohnH said:
As you see required here is TypeName, a unique string that identifies the type to create a new instance of. This need to be saved as part of the ControlState, for simplicity add a TypeName field
...
and save it with the rest in constructor (the Sub New(ctl) method)
Are you finding very many Sub New(ctl) constructors in ControlState?? or other places in project?? I don't follow you.
 
I see no reason why it wouldn't, it did when I tried.
 
well can you show me where you put it? cause it is not working for me.
it still only loads 1 control, regardless of how many i save.
 
pseudo
VB.NET:
sub new(ctl)
  set TypeName 
  for all properties...end for
  for all child controls...end for
end sub
What do you mean "how many i save."? The class is designed to save a single form including all child controls.
 
The specified code works just fine for saving and loading all controls on form. I am not able to reproduce your problem.
 
Back
Top