View previous topic :: View next topic |
Author |
Message |
Cryoma Member of the Year
Reputation: 198
Joined: 14 Jan 2009 Posts: 1819
|
Posted: Thu Dec 06, 2007 2:19 pm Post subject: I found a VBC# 2005 CD on the street! |
|
|
Or something like that,
Anyway I've just spent an hour learning the basics, without reading the instruction. (I'm a fast learner like that)
It's my first time writing C# but it seems pretty simple.
Anyway I need help making a button on Form1 that when you click opens up Form2 in a new window.
I went to Form1.cs and made:
Code: |
private void get_Form2(object sender, EventArgs e)
{
} |
Then I set the buttons actions to
but what code do I put in the
To make the button work?
Thankies in advance.
|
|
Back to top |
|
 |
goldengold Grandmaster Cheater Supreme
Reputation: -1
Joined: 11 Nov 2006 Posts: 1841 Location: -.-
|
Posted: Thu Dec 06, 2007 2:49 pm Post subject: |
|
|
what do you want it to do?
type Code: |
Messagebox.show ("i bet you're not this leet ;D");
|
_________________
|
|
Back to top |
|
 |
Cryoma Member of the Year
Reputation: 198
Joined: 14 Jan 2009 Posts: 1819
|
Posted: Thu Dec 06, 2007 2:53 pm Post subject: |
|
|
I want it to open form2 in a popup.
Btw thanks for that code, it makes a lot of sense and I understand C# a bit better.
|
|
Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Thu Dec 06, 2007 2:53 pm Post subject: |
|
|
declare your new form.
Code: | Form2 form2 = new Form2(); |
put this on your button.
like magic.
Last edited by hcavolsdsadgadsg on Thu Dec 06, 2007 2:56 pm; edited 2 times in total |
|
Back to top |
|
 |
Cryoma Member of the Year
Reputation: 198
Joined: 14 Jan 2009 Posts: 1819
|
Posted: Thu Dec 06, 2007 2:54 pm Post subject: |
|
|
wait, it says
Error 1 'WindowsApplication1.NMM1' does not contain a definition for 'get_Form2' C:\Documents and Settings\myname\My Documents\Visual Studio 2005\Projects\projectnameblahblah\Form1.Designer.cs 46 64 projectname
this is what I did
EDIT: OH SHI- I'M AN IDIOT.
|
|
Back to top |
|
 |
|