Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


C# HELP

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Microsoft
Grandmaster Cheater
Reputation: 0

Joined: 01 Dec 2007
Posts: 730
Location: O-('-'Q)

PostPosted: Thu Oct 30, 2008 7:18 pm    Post subject: C# HELP Reply with quote

I was following a tutorial to make an internet browser that came with the C# 2008 program. I noticed I had several errors all which related to this statement.

Code:
        private void homeToolStripMenuItem_Click(object sender, System.EventArgs e)
        {
        webBrowser1.GoHome();
        }   


the only thing underlined in red is the void command.
Why is this?

_________________
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Thu Oct 30, 2008 8:13 pm    Post subject: Reply with quote

What's the code before?
_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
FullyAwesome
I post too much
Reputation: 0

Joined: 05 Apr 2007
Posts: 4438
Location: Land Down Under

PostPosted: Thu Oct 30, 2008 11:43 pm    Post subject: Reply with quote

did you close off the previous code with a } bracket?
_________________
Back to top
View user's profile Send private message MSN Messenger
Microsoft
Grandmaster Cheater
Reputation: 0

Joined: 01 Dec 2007
Posts: 730
Location: O-('-'Q)

PostPosted: Fri Oct 31, 2008 1:18 pm    Post subject: Reply with quote

fullyawesome wrote:
did you close off the previous code with a } bracket?


yes they are all closed off with brackets but, the only thing that says is an error is the void part of the code

_________________
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Spawnfestis
GO Moderator
Reputation: 0

Joined: 02 Nov 2007
Posts: 1746
Location: Pakistan

PostPosted: Fri Oct 31, 2008 3:15 pm    Post subject: Reply with quote

Gatekeeper wrote:
fullyawesome wrote:
did you close off the previous code with a } bracket?


yes they are all closed off with brackets but, the only thing that says is an error is the void part of the code

I don't get why it couldn't be void, it isn't returning anything, so it should be okay.
Post your full source and errors (pastebin.com) for us to help you.

_________________

CLICK TO HAX MAPLESTORAY ^ !!!!
Back to top
View user's profile Send private message Send e-mail MSN Messenger
yoyonerd
Grandmaster Cheater
Reputation: 0

Joined: 26 Apr 2008
Posts: 699
Location: -->formerly yoyonerd<--

PostPosted: Fri Oct 31, 2008 3:35 pm    Post subject: Reply with quote

i agree with spawn, everything looks completely fine

post the source and errors, it'll make things much easier

we might be able to help with just the errors, but we can fix it for you if we have the source

_________________
Back to top
View user's profile Send private message AIM Address
sloppy
Expert Cheater
Reputation: 0

Joined: 17 Aug 2008
Posts: 123

PostPosted: Sat Nov 01, 2008 1:11 am    Post subject: Reply with quote

My guess is, you have your method outside the main class or you don't have a class defined.

Code:
class MyClass // This is a class.
{
      // All of your code belongs inside.

      private void homeToolStripMenuItem_Click(object sender, System.EventArgs e)
      {
            webBrowser1.GoHome();
      }
}

// Not outside!
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Sat Nov 01, 2008 2:55 am    Post subject: Reply with quote

Do you not need an entry point?

Code:
public int main( String[] args ) {

}
Back to top
View user's profile Send private message MSN Messenger
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Sat Nov 01, 2008 7:57 am    Post subject: Reply with quote

noz3001 wrote:
Do you not need an entry point?

Code:
public int main( String[] args ) {

}


This is WinForms stuff. Typically the entry point is in the Program.cs file--that's the default, and I'm assuming he's left it there.

Edit:

Here's the default entry point:

Code:

        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Main());
        }

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
Microsoft
Grandmaster Cheater
Reputation: 0

Joined: 01 Dec 2007
Posts: 730
Location: O-('-'Q)

PostPosted: Sat Nov 01, 2008 11:51 am    Post subject: Reply with quote

nevermind guys, thanks a ton fro the help. though. Turns out for some reason the we browser was deleted from the application.

works fine now, thanks a bunch, though.

_________________
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites