Re: Anyone have a HOWTO on this requirement?

From: james (nospam_at_hypercon.net)
Date: 07/14/04


Date: Wed, 14 Jul 2004 12:35:00 -0500

You can just manually save and load the properties of the controls you want
to save. Reflection isn't going to help you if you dont know what you are
storing because you may attempt to store things you dont need to store and
re-storing them might cause issues if done in an incorrect order. Basically
what I would do is create an interface like IRestorable or some such and
then subclass all the controls you want to be able to restore, and implement
that interface in the control. Then your form can just go through all its
controls and call the store/restore method. Each control should know then
what it needs to do and how it needs to do it.

By the way, I use DevExpress's tools which can all store/restore themselves

JIM

"Tilfried Weissenberger" <tilli@weissenberger.at> wrote in message
news:1089750010.830191@news.aic.at...
> Thanks all for your responses.
>
> Unfortunately my example of the size/position is just for demonstration
> purpose. I inherit from a common form, which does that for me already. I
> just want to be able to add more attributes, such as column-width of
grids,
> width of dynamically positioned sliders etc. - I want to be able to pass a
> list of objects/properties to a function which will then either save the
> state to the registry (that's the easy part), or load it from there back
> into the properties (that's where I have the problem)!
>
> so it's not a conventional solution I require - I guess I have to use
> Reflection to do what I want - someone out there must know how this can be
> accomplished!
>
> Thanks for any further input!
>
> regards, Tilli
>
>



Relevant Pages

  • RE: Usage of AppDomain.CreateInstanceFromAndUnwrap method
    ... The reason for other failures is that Controls are not inherited from ... so the program will attempt to load them into the ... Create an AppDomain, do a CreateInstanceAndUnwrap on ... Assemblies in to a seprate ...
    (microsoft.public.dotnet.framework.clr)
  • Re: The Command event of dynamically loaded controls
    ... to load a hierarchical list of folders and files from a database and display ... I'll need to load the folder list in the first pass to wire up the ... controls and corresponding event handlers. ... > and triggers events. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Form Performance
    ... can take a lot of time to load. ... it is not the number of controls. ... So, combo box controls, and sub-form controls are very expensive in terms ... > that tab. ...
    (microsoft.public.access.modulesdaovba)
  • RE: Better multiple forms or.....?
    ... Keep in mind that default behavior is for a form to load all controls on it ... also be possible to use this approach with panels or a tab control. ... is running that could consume significant memory. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: UserControl HELP
    ... I spent a lot of time for create an ocx as flessible ... > from a database how many control load and than load the page. ... > I need to know if there is some tips for the create a faster ocx. ... they have to load the controls ...
    (microsoft.public.vb.controls)