Solved

picture help

Posted on 1998-11-11
2
123 Views
Last Modified: 2011-09-20
Let say, I must do this and I don't want to load the one.gif from vb design time  :

main1form.picture =loadpicture("c:\math253\images\one.gif")

to load the one.gif from the directory c:\math253\images.
and my vb program(.exe) must be in math253 directory.

so I must setup my program in c:\math253 ...., right ?

if I save everything in A drive without changing anything, or if I save everything in c:\ada like c:\ada\math253...
why my program can't run ? Is there a way I can run my vb program in anywhere or any directory or something like
c:\ada\math\math253...  ? If yes, can you tell me how and I would like the detail and code. Remember one.gif must be in math\253\images\

Thank a lot
0
Comment
Question by:tanc02
2 Comments
 
LVL 2

Accepted Solution

by:
kswinney earned 110 total points
ID: 1444346
Yes.  You'll load the image like this:

main1form.picture =loadpicture(App.Path & "\images\one.gif")

In the design environment, the app.path will return the directory from which you're running the .VBP project file (or the VB installation directory if you haven't yet saved the project).

With the compiled executable, however, this will always return the place from which the EXE was run.  You'll probably want to save a copy of the image off of your project directory in the \Images directory so it works both in the environment and when compiled.

Good luck!
0
 
LVL 1

Author Comment

by:tanc02
ID: 1444347
I am confused. Ok let say I have this :

main1form.picture =loadpicture(App.Path & "\images\one.gif")

after I finished the designing the program, I make it EXE file.

So does that mean I can run this program(.exe) in anywhere like copy everything into
A drive or put everything in another sub-sub directory like
c:\math\tan\math253

Is that correct ? My program will run
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

830 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