Solved

Visual Studio 2005 - Add existing item - Form

Posted on 2010-11-11
6
765 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now