Solved

Shared Image For Button.

Posted on 2008-10-03
8
206 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
  • 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

809 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