Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Background programmatically

Status
Not open for further replies.

thegame8311

Technical User
Jan 6, 2012
133
US
I wanna have a image background on a form based on a button click
I think it should be

Code:
thisform.Picture = 'pic.bmp'

so what am i missing, because it is not changing the background of the form
 
Well in this case I added the image to the project as an other file, so how can i use it then, because it still does not show it?
 
Even if the image file is in the project, the form still needs to be able to find it in the current path (the default directory or the search path). Adding it to the project won't fix that.

However, if you are building the app into an EXE, then you are right to add the image file to the project. But be sure that it is not excluded (right-click on it, and choose Include; if you can't see Include on the menu, it is already included).

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
A refresh of the form also might be helpful, after setting the picture. thisform.refresh().

Bye, Olaf.
 
Put the damn full path of the BMP onto the file name and be done with it. If that doesn't work, you have a non-valid BMP file.

If it does work, you're done. The project manager will resolve file locations when you compile.
 
Ok, it works for development working, it needs the path, but once the app/exe is built then it uses the file included in the project, now I understand, thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top