Solved

Visual Studio 2005 - Add existing item - Form

Posted on 2010-11-11
6
768 Views
Last Modified: 2012-05-10
Hi,
  When I try to use a form from an old project in my new project, I can usually Right click on the project, then hit "Add" | "Existing Item" then point to my windows form in my old project and all is good.

However if the form  has an embedded image for a background image, when I try and open up that form in my new project, all I get is

some HTML stuff saying something about
...
this.BackgroundImage = global::myProject.Properties.Resources.splash4;
The code within the method 'InitializeComponent' is generated by the designer and should not be manually modified.  Please remove any changes and try opening the designer again.

how do I fix this?

Thanks

0
Comment
Question by:carl-
  • 5
6 Comments
 
LVL 7

Expert Comment

by:rogerard
ID: 34115287
When you're adding the old form, make sure you also add it's associated files, like it's .resx and/or .designer.vb
0
 
LVL 4

Author Comment

by:carl-
ID: 34116020
the associated forms designer.cs and form.resx get added automatically.  Problem is the background image is under the global resource:  Properties Resources.resx Resources.Designer.cs and the namespace was different, so it cant find it and thus cant open.  I cant figure out how to change the namespace of that resource in the form that wont open because well, it wont open :-)
0
 
LVL 4

Accepted Solution

by:
carl- earned 0 total points
ID: 34116190
figured it out. I went into the form.designer.cs file and edited the background image in the part that says "Windows Form Designer generated code.
 this.BackgroundImage = global::<exe_name>.Properties.Resources.splash4;

turned out to be exe_Name, not namespace name.

all is well now.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Author Comment

by:carl-
ID: 34116213
sorry, make that default Namespace name. (That is supplied by right clicking on the project and reading the application tab's default namespace.
0
 
LVL 4

Author Comment

by:carl-
ID: 34116404
if there was an "Award Points" for answering without "Accepting as solution" I'd gladly do that, but it wasn't the solution so I cant.
0
 
LVL 4

Author Closing Comment

by:carl-
ID: 34143513
just closing out question that I figured out.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Groupbox Control ? 2 27
How can I do Unit Testing with Session ? 1 23
I need help adding validation to my MVC.Net view 6 21
Need help with a query 14 34
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question