Solved

picture help

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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 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…

864 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

16 Experts available now in Live!

Get 1:1 Help Now