Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

picture help

Posted on 1998-11-11
2
Medium Priority
?
126 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
kswinney earned 220 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

705 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