How do I fix this error?
-
Tried to.Still not fixed. When I put a descriptive name, it tell me that namespace with that descriptive name already contains a definition for that name .
-
Angelinna wrote:
Tried to.Still not fixed.
By any chance did you remove the
partial
keyword?*jaans
Good idea.
Simon
-
Angelinna wrote:
Tried to.Still not fixed.
By any chance did you remove the
partial
keyword?*jaans
-
Angelinna wrote:
Yes. I removed it earlier on.
Why?
Recent blog posts: *Method hiding Vs. overriding *Microsoft Surface *SQL Server / Visual Studio install order My Blog
-
Well, put it back and see if that works with your rename of the form etc.
Bob Ashfield Consultants Ltd
-
Asside from the fact that you are missing several close brackets '}', which I'm assuming are just because you didn't copy and paste them. You need to put the word 'partial' back into your code. You can't just go removing word without understanding what they mean. The main declaration of the from should be
public partial class Form1 : Form
The declaration in the Designer.cs file should be
partial class Form1
Simon
-
Asside from the fact that you are missing several close brackets '}', which I'm assuming are just because you didn't copy and paste them. You need to put the word 'partial' back into your code. You can't just go removing word without understanding what they mean. The main declaration of the from should be
public partial class Form1 : Form
The declaration in the Designer.cs file should be
partial class Form1
Simon
-
When I do that correction, it then tell me that Error The type 'TictacGame.Form1' already contains a definition for 'Startbutton' and the same for all the buttons shown in the code in my previous message. Why is that?
Angelinna wrote:
Error The type 'TictacGame.Form1' already contains a definition for 'Startbutton'
Because you've probably declared them twice. Just a quick suggestion. Don't go messing with the code in the Designer.cs file. That's how you've got yourself into this mess. Stick to just using the GUI.
Simon
-
How do I fix this error which says "The namespace 'Game' already contains a definition for 'Form1'" What does it mean and how do I fix it. It resulted after I wrote this; public class Form1: System.Windows.Forms.Form Thanks.
try to change the input parameters of the Constructor
-
Angelinna wrote:
Error The type 'TictacGame.Form1' already contains a definition for 'Startbutton'
Because you've probably declared them twice. Just a quick suggestion. Don't go messing with the code in the Designer.cs file. That's how you've got yourself into this mess. Stick to just using the GUI.
Simon
Simon Stevens wrote:
Don't go messing with the code in the Designer.cs file.
I tell my students that all the time, and yet, when they have some sort of mess up, that is the root cause.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham