J
Jon Slaughter
I have some static fields in a class to keep track of "global" information
but this information is local to each form that the class is used on.
e.g., the class represents a base control(inherited from
System.Windows.Forms.Control) but keeps static information for all the
controls on the form (such as a global control style property). The problem
I just realized is that if I want to have multiple forms then I'm screwed if
the static fields are global to all controls created even though they might
be on different forms(so it would change the style of all controls that
exist even on different forms). This might not be so bad for a "global"
style but I also have other information that can be different on different
forms(but common to all controls on that form).
So is the method of using static fields impossible for this?
The reason I have this is so that I can easily change the global styles
instead of having to loop through all the controls on the form but it seems
like this might be my only choice?
Any ideas about this?
Thanks,
Jon
but this information is local to each form that the class is used on.
e.g., the class represents a base control(inherited from
System.Windows.Forms.Control) but keeps static information for all the
controls on the form (such as a global control style property). The problem
I just realized is that if I want to have multiple forms then I'm screwed if
the static fields are global to all controls created even though they might
be on different forms(so it would change the style of all controls that
exist even on different forms). This might not be so bad for a "global"
style but I also have other information that can be different on different
forms(but common to all controls on that form).
So is the method of using static fields impossible for this?
The reason I have this is so that I can easily change the global styles
instead of having to loop through all the controls on the form but it seems
like this might be my only choice?
Any ideas about this?
Thanks,
Jon