Solved

picture help

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now