Global Data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What is the best way to handle global application data in a windows forms?
How about a VB module?
 
Arne,

Personally I don't like modules - can't think off hand why but it does bring
back cold sweats and shivers from pre OO days :P

There is a resources secion of the project where you can store all the
global application now and be accessed with My.Application if you are using
VB (c# there is another way to access it as there is no My namespace in c#).
Click show all files in your project and you will see it... Or you can have
a look at:
http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=45 or
http://msdn2.microsoft.com/en-us/library/k4s6c3a0.aspx

HTH
Brendon
 
I found out how to set an application setting, but can't retrieve a setting.
How do I retrieve a setting?
csharpfriend doesn not respond.
--
Arne Garvander
Certified Geek
Professional Data Dude


Brendon Bezuidenhout said:
Arne,

Personally I don't like modules - can't think off hand why but it does bring
back cold sweats and shivers from pre OO days :P

There is a resources secion of the project where you can store all the
global application now and be accessed with My.Application if you are using
VB (c# there is another way to access it as there is no My namespace in c#).
Click show all files in your project and you will see it... Or you can have
a look at:
http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=45 or
http://msdn2.microsoft.com/en-us/library/k4s6c3a0.aspx

HTH
Brendon
 
Global is kind of a dirty word in object oriented programming.

You should use a singleton pattern if you want the simplest solution. If
your application is likely to be large or complex I strongly recommend CAB
and the creation of a service that can be manages using the dependency
injection system it provides.

The dirty method, if you're really _really_ lazy and wish to be ridiculed by
all who know you, is a static class with static fields.

--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Back
Top