![]() |
|
|
|
| ||||||
|
Welcome to the The ProgrammersTalk Community forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| Tags: actionlistener, gui, help, programming |
![]() |
![]() | | LinkBack | Thread Tools | Display Modes | ![]() |
| |
| |||
| Quote:
a static function inside a class doesn't belong to objects created of that class, but to the class itself (Where a class is like a cookie-cutter for objects. Many instances/objects of the class can exist, but the class itself only exists once). in a way, a static function is like a global function, which exists once and only once for the lifetime of the entire program. In fact, a class can create objects of itself at any time. Although a constructor should be careful in creating objects of its own class, since there is the potential for an infinite loop there (an object's constructor calling an object's constructor calling an object's constructor.. etc) As to the original error message, I think C# does an unusual thing of capitalising the first letter of Main() - your main() is a lowercase 'm' (as per C/C++/Java) Last edited by Bench : 08-06-2007 at 11:07 AM. |
| The Following User Says Thank You to Bench For This Useful Post: | ||
TeraTask (08-06-2007) | ||
| ||||
| Quote:
|
| ||||
| LOL, this is really dumb.. I had to do this to get the GUI works ![]() PHP Code: |
| |||
| And for the record, creating a new instance of a form class is only half the battle. You can create and cache instances for later use ... but if you don't call Form.Show() or Form.ShowDialog() ... which Application.Run() does ... nothing happens. In theory just instantiating a new form would allocate some memory and call its constructor, but I think the compiler will recognize that you're never using the object, and optimize it out of the final code. |
| ||||
| Quote:
But I'm not sure where should I put that line that you're talking about here? I just instantiate the instance of the Form1 on my current code, where do you see the Form.Show() ??? ![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |