Post: C# Code
08-31-2011, 10:39 AM #1
Pauly
Banned
(adsbygoogle = window.adsbygoogle || []).push({}); i am new to C# and i need the code to make a button open another form
Last edited by Pauly ; 08-31-2011 at 10:42 AM.

The following user groaned Pauly for this awful post:

CodingNation
09-01-2011, 10:34 PM #2
Woof
...hmm
Here.
    Form name = new Form();
name.Show();

The following user thanked Woof for this useful post:

09-01-2011, 11:24 PM #3
Epic?
Awe-Inspiring
Originally posted by Chrome
i am new to C# and i need the code to make a button open another form


Note that BAdmaNgLiTcHa's code is correct. Just thought you should know that you'd have to actually put that in the button event area. You can drag the button onto your form, double click it. You'll be taken to the code with a new "stub" of code that has been generated. Then you can insert the code into that stub, replacing 'Form' with the name of your form, and 'name' with the name of the new object/initialization of your form.

Also, you can use name.ShowDialog() or name.Show(). There's very little difference.
09-03-2011, 06:40 PM #4
Correy
I'm the Original
Originally posted by AsianInvasion View Post
Note that BAdmaNgLiTcHa's code is correct. Just thought you should know that you'd have to actually put that in the button event area. You can drag the button onto your form, double click it. You'll be taken to the code with a new "stub" of code that has been generated. Then you can insert the code into that stub, replacing 'Form' with the name of your form, and 'name' with the name of the new object/initialization of your form.

Also, you can use name.ShowDialog() or name.Show(). There's very little difference.


name.Show(); does not work, i know this cause i've tried it numerous amount of times when i first started C#
09-04-2011, 03:49 AM #5
Epic?
Awe-Inspiring
Originally posted by Correy View Post
name.Show(); does not work, i know this cause i've tried it numerous amount of times when i first started C#


Ahem?

09-04-2011, 08:10 AM #6
Woof
...hmm
Originally posted by Correy View Post
name.Show(); does not work, i know this cause i've tried it numerous amount of times when i first started C#

Make sure you have set the set the value of [name] and it should work Drinking Coffee

Originally posted by AsianInvasion View Post
Note that BAdmaNgLiTcHa's code is correct. Just thought you should know that you'd have to actually put that in the button event area. You can drag the button onto your form, double click it. You'll be taken to the code with a new "stub" of code that has been generated. Then you can insert the code into that stub, replacing 'Form' with the name of your form, and 'name' with the name of the new object/initialization of your form.

Also, you can use name.ShowDialog() or name.Show(). There's very little difference.

Thanks for explaining what I meant to him, I was in a lazy mood at the time Happy
Last edited by Woof ; 09-04-2011 at 08:13 AM.

The following user thanked Woof for this useful post:

Epic?
09-04-2011, 01:24 PM #7
Correy
I'm the Original
Originally posted by AsianInvasion View Post
Ahem?



ah hem, how you have but Form2 AsianInvasion = new Form2();
09-04-2011, 06:50 PM #8
Epic?
Awe-Inspiring
Originally posted by Correy View Post
ah hem, how you have but Form2 AsianInvasion = new Form2();


Clearly you didn't read my very first post to this thread. First off, you should declare Form2 as an object whether you're simply using ShowDialog or Show, its common programming practice...

Buddy, I've started C programming when I was 8, I've been programming in C# for over a year now, I know what I'm talking about.
09-04-2011, 07:01 PM #9
Correy
I'm the Original
Originally posted by AsianInvasion View Post
Clearly you didn't read my very first post to this thread. First off, you should declare Form2 as an object whether you're simply using ShowDialog or Show, its common programming practice...

Buddy, I've started C programming when I was 8, I've been programming in C# for over a year now, I know what I'm talking about.


so your trying to say i don't you mad, who erm.. created an .FF Viewer with BuC-ShoTz, oh yeah.
and erm, your only 9
Originally posted by another user

Buddy, I've started C programming when I was 8, I've been programming in C# for over a year now, I know what I'm talking about.

lmao =D!

The following user groaned Correy for this awful post:

09-04-2011, 08:11 PM #10
Epic?
Awe-Inspiring
Originally posted by Correy View Post
so your trying to say i don't you mad, who erm.. created an .FF Viewer with BuC-ShoTz, oh yeah.
and erm, your only 9

lmao =D!


Sorry, but your logic to determine my age is flawed. There is an indeterminable amount of time between start time (age Cool Man (aka Tustin) with the programming language C and the start time (one year ago) with C#, C != C#.

Also, my technique is correct, and I proved it to you. Creating an FF viewer isn't necessarily complex, and you clearly don't know much about programming, because I just proved to you that "name.Show()" is as effective as "name.ShowDialog()".

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo