Click here to Skip to main content
15,913,944 members
Home / Discussions / C#
   

C#

 
GeneralRe: Find unique strings for a string array Pin
George_George23-Dec-08 22:37
George_George23-Dec-08 22:37 
GeneralRe: Find unique strings for a string array Pin
DanB198324-Dec-08 0:22
DanB198324-Dec-08 0:22 
GeneralRe: Find unique strings for a string array Pin
George_George24-Dec-08 20:51
George_George24-Dec-08 20:51 
Questionhow can made c#.net messenger? Pin
mohammedali200622-Dec-08 10:48
mohammedali200622-Dec-08 10:48 
AnswerRe: how can made c#.net messenger? Pin
Christian Graus22-Dec-08 11:00
protectorChristian Graus22-Dec-08 11:00 
GeneralRe: how can made c#.net messenger? Pin
EliottA22-Dec-08 11:09
EliottA22-Dec-08 11:09 
GeneralRe: how can made c#.net messenger? Pin
Christian Graus22-Dec-08 11:18
protectorChristian Graus22-Dec-08 11:18 
GeneralRe: how can made c#.net messenger? Pin
EliottA22-Dec-08 11:20
EliottA22-Dec-08 11:20 
GeneralRe: how can made c#.net messenger? Pin
PIEBALDconsult22-Dec-08 13:10
mvePIEBALDconsult22-Dec-08 13:10 
GeneralRe: how can made c#.net messenger? Pin
Christian Graus22-Dec-08 13:45
protectorChristian Graus22-Dec-08 13:45 
GeneralRe: how can made c#.net messenger? Pin
PIEBALDconsult22-Dec-08 14:25
mvePIEBALDconsult22-Dec-08 14:25 
GeneralRe: how can made c#.net messenger? Pin
Christian Graus22-Dec-08 17:01
protectorChristian Graus22-Dec-08 17:01 
GeneralRe: how can made c#.net messenger? Pin
PIEBALDconsult23-Dec-08 12:22
mvePIEBALDconsult23-Dec-08 12:22 
QuestionEfficient way of accessing a Boolean from SQL Server Pin
Andreas_198322-Dec-08 9:35
Andreas_198322-Dec-08 9:35 
AnswerRe: Efficient way of accessing a Boolean from SQL Server Pin
Not Active22-Dec-08 10:02
mentorNot Active22-Dec-08 10:02 
AnswerRe: Efficient way of accessing a Boolean from SQL Server Pin
shea-c422-Dec-08 10:24
shea-c422-Dec-08 10:24 
GeneralRe: Efficient way of accessing a Boolean from SQL Server Pin
Andreas_198322-Dec-08 10:59
Andreas_198322-Dec-08 10:59 
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.

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.