Click here to Skip to main content
15,897,371 members
Home / Discussions / C#
   

C#

 
GeneralRe: Efficient way of accessing a Boolean from SQL Server Pin
Mycroft Holmes22-Dec-08 15:07
professionalMycroft Holmes22-Dec-08 15:07 
GeneralRe: Efficient way of accessing a Boolean from SQL Server Pin
jchandramouli22-Dec-08 18:41
jchandramouli22-Dec-08 18:41 
GeneralRe: Efficient way of accessing a Boolean from SQL Server Pin
Mycroft Holmes22-Dec-08 18:50
professionalMycroft Holmes22-Dec-08 18:50 
QuestionVS2008 and Updating controls ? [modified] Pin
Mike Bluett22-Dec-08 8:43
Mike Bluett22-Dec-08 8:43 
AnswerRe: VS2008 and Updating controls ? Pin
Not Active22-Dec-08 10:14
mentorNot Active22-Dec-08 10:14 
GeneralRe: VS2008 and Updating controls ? Pin
Mike Bluett24-Dec-08 7:07
Mike Bluett24-Dec-08 7:07 
GeneralRe: VS2008 and Updating controls ? Pin
Not Active24-Dec-08 8:16
mentorNot Active24-Dec-08 8:16 
GeneralRe: VS2008 and Updating controls ? Pin
Mike Bluett24-Dec-08 9:10
Mike Bluett24-Dec-08 9:10 
It should not be an advanced topic!!

This is something ANY programmer would want to do with almost ANY program.

Besides before posting here I have done extensive reading in all kinds of C# books and resources and cannot find an answer to my problem. Basically, I am trying to understand why Microsoft would create such a complicated approach to doing what should be incredibly simple.

What I want to do is simply use a GLOBAL reference to Form1 so that I can setup an object reference to Form1 so that it can be accessed from another method within the Program class (or in my case the FileOrganizer class).

I am forced to use the "Application.Run" method; otherwise, the application will quit after it finishes executing my code. The Microsoft template places the "Run" call within Main. Because Main must be static, it will not let me create a GLOBAL reference to "Form1". I can create an object reference to Form1 within Main; however, it is not GLOBAL and I cannot access it from another method in the FileOrganizer class.

I am sure that Microsoft, in their infinite wisdom, provided a mechanism to accomplish this in a simple fashion; however, it is not obvious to me.

I had previously written another program (which I started in SharpDevelop). In this program, all of the modifications to the main form are done through events.

However, in my current program, there are no events that get fired (i.e., mouse clicks). What I am doing is reading some data from a database trying to use that data to populate a TreeView (which resides on the main form).

If I could create a GLOBAL variable, this would be incredibly simple to implement. Because I can't this becomes a major complication. Why it has to be this complicated is beyond me; however, I am willing to spend the time to understand it.

If you know of some code I can reference in some book or some web reference that can help me to understand this I would be very grateful.
GeneralRe: VS2008 and Updating controls ? Pin
Not Active24-Dec-08 9:46
mentorNot Active24-Dec-08 9:46 
GeneralRe: VS2008 and Updating controls ? Pin
Mike Bluett24-Dec-08 9:57
Mike Bluett24-Dec-08 9:57 
AnswerRe: VS2008 and Updating controls ? Pin
Dragonfly_Lee22-Dec-08 21:19
Dragonfly_Lee22-Dec-08 21:19 
GeneralRe: VS2008 and Updating controls ? Pin
Mike Bluett23-Dec-08 10:32
Mike Bluett23-Dec-08 10:32 
GeneralRe: VS2008 and Updating controls ? Pin
Dragonfly_Lee23-Dec-08 21:10
Dragonfly_Lee23-Dec-08 21:10 
GeneralRe: VS2008 and Updating controls ? Pin
Mike Bluett24-Dec-08 7:05
Mike Bluett24-Dec-08 7:05 
GeneralRe: VS2008 and Updating controls ? Pin
Not Active24-Dec-08 8:11
mentorNot Active24-Dec-08 8:11 
AnswerRe: VS2008 and Updating controls ? Pin
Mike Bluett24-Dec-08 14:12
Mike Bluett24-Dec-08 14:12 
QuestionNeed Help in How to hook and re-route the c# function calls Pin
venkatcontact22-Dec-08 8:27
venkatcontact22-Dec-08 8:27 
AnswerRe: Need Help in How to hook and re-route the c# function calls Pin
Not Active22-Dec-08 10:10
mentorNot Active22-Dec-08 10:10 
QuestionSpecify entire app.config at runtime Pin
Chazzysb22-Dec-08 5:00
Chazzysb22-Dec-08 5:00 
AnswerRe: Specify entire app.config at runtime Pin
Not Active22-Dec-08 10:07
mentorNot Active22-Dec-08 10:07 
Question.NET 2.0 Windows Service Deployment error on Windows 2008 server. Pin
Member 357347622-Dec-08 4:22
Member 357347622-Dec-08 4:22 
QuestionWriting to an Access DB locks DB Pin
Planker22-Dec-08 3:49
Planker22-Dec-08 3:49 
AnswerRe: Writing to an Access DB locks DB Pin
Dave Kreskowiak22-Dec-08 4:39
mveDave Kreskowiak22-Dec-08 4:39 
GeneralRe: Writing to an Access DB locks DB Pin
Planker22-Dec-08 5:01
Planker22-Dec-08 5:01 
AnswerRe: Writing to an Access DB locks DB Pin
Wendelius22-Dec-08 8:22
mentorWendelius22-Dec-08 8:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.