Page 1 of 1

C# help

Posted: Wed Apr 23, 2008 3:39 pm
by mr_penguin
Where can I find info on learning C#? Microsoft's site has tons of VB things but I can't find much for C# there.

Posted: Wed Apr 23, 2008 4:14 pm
by xzodia
there should be an option near the top to switch languages

Posted: Wed Apr 23, 2008 4:41 pm
by Aumaan Anubis

Posted: Thu Apr 24, 2008 8:50 am
by mr_penguin
thanks.

for some reason it wouldn't give me that page the other day. The whole bottom part of it was blank.

Posted: Thu Apr 24, 2008 2:37 pm
by mr_penguin
How can I open another form by pressing a button?

Posted: Thu Apr 24, 2008 2:51 pm
by Aumaan Anubis
Depends. For instance, if you want to open a generic form with C#, you can use...

Code: Select all

private void button1_Click(object sender, EventArgs e)
        {
            Form objform = new Form();
            objform.Show();
        }
But if you want a specific form to load, you can create that form with its specific attributes, and assuming that it is called form2.cs, you can use...

Code: Select all

private void button1_Click(object sender, EventArgs e)
        {
            Form2 objform2 = new Form2();
            objform2.Show();
        }

Posted: Thu Apr 24, 2008 3:38 pm
by Supermodder911
Aumaan Anubis wrote:But if you want a specific form to load, you can create that form with its specific attributes, and assuming that it is called form2.cs, you can use...
The file name doesn't matter. The class name is what you are looking for.

Posted: Thu Apr 24, 2008 4:11 pm
by Aumaan Anubis
Ahh, you are indeed right.