Hi there
Can anyone help.. Im getting this error : Duplicate declaration of member 'Location'
and on my form all controls is on the left top corner.
Is there anyway to fix this?
When i run the program it looks ok, but once i make a change or try to then it stays that way.
Loading

AlanRank #669 · 3.6K reputationPosted Jul 23, 2007, 8:43 AM EDT
Well all forms inherit a Location property.
Have you, by any chance, tried to declare your own Location property on a form?
If you have then change it to something else, Position perhaps, and the error should (hopefully) go away.
Felipe Marks72 reputationPosted Jul 23, 2007, 11:27 PM EDT
I have not declared my own Location property on the form. I have back-ups of the program where the form is still normal. Once I make a change to the code and go back to the form view. This happens. The code changes works fine but now I cant edit the form or any controls else it'll be like that when I run the program. I'm using VS 2003 if that helps.
Thanks
Jan MontanoRank #1,295 · 1.3K reputationPosted Jul 24, 2007, 12:07 AM EDT
But if you just rebuild the project without modifying anything? does the error appear?
If it does, maybe it has something to do with the namespaces you're using. Maybe one of the namespaces contain a Location class or property.
If it doesn't, I can't think of any. If my program is not that big, I'll try to recreate it in another project and see if the error will still occur.
Regards,
Jan
Felipe Marks72 reputationPosted Jul 24, 2007, 4:27 AM EDT
Thanks for your assistance.
No error appears after I rebuild. My program is actually very big. It only happens to one of my forms though so i'll try and do it over.
thanks,
Eustace
Felipe Marks72 reputationPosted Jul 24, 2007, 11:57 PM EDT
I've tried another form and experiencing the same thing. One of the control forms I use
I created myself and it hanppened while i did code using that control.
Could the error be cause of that?
thanks,
Eustace
Jan MontanoRank #1,295 · 1.3K reputationPosted Jul 25, 2007, 1:17 AM EDT
Felipe Marks72 reputationPosted Jul 25, 2007, 5:30 AM EDT
I created a class seperate from my program called RichTextBoxPrintCtrl.cs
I can copy all the code if you like?
anyway I also added these references System.Drawing.dll and System.Windows.Forms.dll
Then i created a .dll after build solution
Then i added it to the references and then to my form.
I hope that explains it well.
Jan MontanoRank #1,295 · 1.3K reputationPosted Jul 25, 2007, 6:31 PM EDT
Felipe Marks72 reputationPosted Jul 27, 2007, 1:05 AM EDT
I used this example, maybe it will help : http://support.microsoft.com/default.aspx/kb/812425
The problem only started a while after i used this code though.
thanks,
Eustace