G
Guest
Visual Studio 2003 / C#
My application has 1 main form. On this form is a treeview object down the
left hand edge and a status bar along the bottom. That is all. The tree
view acts as my menu controller, and when the users click an item, I generate
instances of various UserControls I have for each of the menu items, and add
an instance to the Main form in the right hand area. Some of these
UserControls are just single page objects with fields and buttons etc on
them. Some are a UserControl which for example has a datagrid on page 1,
then another UserControl on page 2 to represent the selected data in this
datagrid on page 1.
I want to be able to publish messages and text to the status bar on my main
form at any point from anywhere in my application. I can achieve this by
passing the "this" value around between objects, then maybe use reflection to
call a method in my main form. But this seems a little lame to me. In
previous languages I have worked with, there has been a Global Parameters
methodology, where I could for example set and get a global property for
"this", then call my setMessage function using this, without the need to pass
it around my objects. Is this possible in .Net? A top level always
available set of parameters?
Thanks
My application has 1 main form. On this form is a treeview object down the
left hand edge and a status bar along the bottom. That is all. The tree
view acts as my menu controller, and when the users click an item, I generate
instances of various UserControls I have for each of the menu items, and add
an instance to the Main form in the right hand area. Some of these
UserControls are just single page objects with fields and buttons etc on
them. Some are a UserControl which for example has a datagrid on page 1,
then another UserControl on page 2 to represent the selected data in this
datagrid on page 1.
I want to be able to publish messages and text to the status bar on my main
form at any point from anywhere in my application. I can achieve this by
passing the "this" value around between objects, then maybe use reflection to
call a method in my main form. But this seems a little lame to me. In
previous languages I have worked with, there has been a Global Parameters
methodology, where I could for example set and get a global property for
"this", then call my setMessage function using this, without the need to pass
it around my objects. Is this possible in .Net? A top level always
available set of parameters?
Thanks