• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 778
  • Last Modified:

Visual Studio 2005 - Add existing item - Form

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
carl-
Asked:
carl-
  • 5
1 Solution
 
rogerardCommented:
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
 
carl-Author Commented:
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
 
carl-Author Commented:
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
carl-Author Commented:
sorry, make that default Namespace name. (That is supplied by right clicking on the project and reading the application tab's default namespace.
0
 
carl-Author Commented:
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
 
carl-Author Commented:
just closing out question that I figured out.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now