Solved

Shared Image For Button.

Posted on 2008-10-03
8
210 Views
Last Modified: 2010-04-23
Hi,

I have windows form that consist of buttons and its of the button have image.
The problem is when copy from one project to another project the image of the button is gone.

The images are save in one folder.

How to solve this problem?

Thank you.
0
Comment
Question by:emi_sastra
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 6

Expert Comment

by:wwnosal
ID: 22634138
Create a resource file in which you will add the images, then you will copy it to new project and you have it there.

Right click on project -> resources, add resource, new image  and pick the type of image you are using.


hope this helps.


0
 
LVL 1

Author Comment

by:emi_sastra
ID: 22634306
Hi wwnosal,

I don't get it.

Let's say I have 3 folder:

1. Image.
2. Project1.
3. Project2.

Project1 has done perfectly with buttons and image on it.

Project1 still open.

Then I create new project (not copied from Project1), add new form (form1) and copy groupbox of button from form of project1 to form1 of project2. After that the images of buttons in form1 of project2 is gone.

Thank you.
0
 
LVL 6

Expert Comment

by:wwnosal
ID: 22634526
How are you placed image on buttons and which IDE you are using. By adding image from properties window on my VS 2005 Express scenario described by you is working correctly, so I have everything copied.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:emi_sastra
ID: 22634582
At project1, I add button to a form and add image using button image property. Choose project resource file.

What's the different between project resource file and local resource ?

Thank you.
0
 
LVL 6

Accepted Solution

by:
wwnosal earned 500 total points
ID: 22634689
OK that's clear now. Resource file is "Project specific" which means that you are adding your graphics into resource file of Project1. In order to have it available after copying the buttons, you would also need to copy the resource file.

If you import from local resource the absolute path to the image is stored and then it will work with Project2 without any other compliations.

To picture it a bit it is in the follwing way:

1. Resource file:
 IDE will look for your image in file ...../ProjectName/ResourceFileName
2. Local resource

Assuming you work on drive D

IDE will look for your image in file D:/your/path/to/image

Furthermore if your not change the resource file name which is Resources.resx it is auto generated.
So in your case your adding image to file Project1/MyProject/Resources.resx but it is searched to be in Project2/MyProject/Resources.resx.


I think you can share a resource file among more projects if you give it a different name than the standard one. Please try doing that. If this not helps find your Resources.resx and copy it into Project2.



0
 
LVL 1

Author Comment

by:emi_sastra
ID: 22634765
Yes, in other word I should use Local Resource, Import then I could copy it to other form without have to worry the resource file.

Using Local Resouce, there is no images added to the project resource file?

Thank you.
0
 
LVL 6

Expert Comment

by:wwnosal
ID: 22634838
Yes use local resource or global resource file but with different name than the standard one (and best located somewhere globally)!
0
 
LVL 1

Author Comment

by:emi_sastra
ID: 22634891
Ok.

Thank you very much for your help.
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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

617 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