Solved

where is Main in this case?

Posted on 2006-10-19
2
159 Views
Last Modified: 2010-04-16
public class TaxReturn holds all information for a tax return;
public class aForm : Form creates a form to enter and change that tax information.

so where should Main go, in TaxReturn or aForm?

is this right? --

    public static void Main()
    {
      TaxReturn mine = new TaxReturn();
      Application.Run(new aForm());
    }

thank you.
0
Comment
Question by:mtnr
2 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 500 total points
ID: 17771752
In Windows application function of Main function is to create and run main application window. In your version, aForm doesn't know anything about TaxReturn, this doesn't make sence. It is better to keep TaxReturn member in the form class:

    public static void Main()
    {
      Application.Run(new aForm());
    }

class aForm: Form
{
    TaxReturn mine;

    public aForm()
    {
           mine = new TaxReturn();

           ...
    }

    ...
}
0
 
LVL 21

Expert Comment

by:theGhost_k8
ID: 17771885
AlexFM is perfact !
as aForm handles event on TaxReturn, its better to make it mamber of aForm as you can easily work upon it.
If ur creationg more than 1 TaxReturn objects, instead of using "Constructor" to initiate.. use that perticular event to do "new TaxReturn()"..

one more reason for trust him :- click on "AlexFM". ;)
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now