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
Felipe MarksPosted Jul 27, 2007, 5:05 AM
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
Jan MontanoPosted Jul 25, 2007, 10:31 PM
Felipe MarksPosted Jul 25, 2007, 9:30 AM
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 MontanoPosted Jul 25, 2007, 5:17 AM
Felipe MarksPosted Jul 25, 2007, 3:57 AM
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
Felipe MarksPosted Jul 24, 2007, 8:27 AM
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
Jan MontanoPosted Jul 24, 2007, 4:07 AM
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 MarksPosted Jul 24, 2007, 3:27 AM
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
AlanPosted Jul 23, 2007, 12:43 PM
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.