Solved

picture help

Posted on 1998-11-11
2
122 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

777 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