[RESOLVED] Question about saving a form
Whenever you save a form, dose it save the pictures that are in the form to? Like if i had a picture of sonic on the form (using the image control) would it save the picture property of that image onto that form, so if i give it to another person, it will load that image?
Re: Question about saving a form
I think, it is true...
Form1.frx this file will contain the data....
Re: Question about saving a form
But using that method is not good... Because, it will increase the file size...
Re: Question about saving a form
ok. Would that method be bigger than sending just the form and the pic with it sepertatly? and to do that method, do you select the form, go to file, then select save *frm as...?
Re: Question about saving a form
You can send the files separately.... Then, load the picture at runtime using loadpicture()...
Example:
Code:
Private Sub Form_Load()
Me.Picture = LoadPicture(App.Path & "\pic.jpg")
End Sub
Re: Question about saving a form
Pictures loaded into controls/forms during design time are saved with the project. Pictures loaded at runtime are not.
Re: Question about saving a form
ok. so your saying that whenever i save a project, it saves the pictures also? So if i upload a project, i dont need to upload the pics to? Just the project?
Re: Question about saving a form
If the pictures were added via Properties during design time, yes.
Just bear in mind that the project includes several files - the .vbp file, .frm files (and the .frx file with the same name), .bas file, .cls files, etc.
Re: Question about saving a form
Quote:
Originally Posted by
Gamemaster1494
ok. so your saying that whenever i save a project, it saves the pictures also? So if i upload a project, i dont need to upload the pics to? Just the project?
Yes, just to educate you a tad more.
For forms, there is a .frx file along with the .frm file when pictures and other data is saved with the project. In your case, the pictures are stored in the .frx file. So as long as you don't lose the .frx file, you don't lose the images. The images are actually compiled into the project.
Other VB objects have such binary sister objects too:
UserControls (.ctl) files have a .ctx
PropertyPages (.pag) files have a .pgx
Designers (.dsr) files hava a .dsx
Notes:
1. This binary sister file won't always exist. It is created as needed by VB.
2. You shouldn't just upload the .exe project either. You should create a setup.exe file with VB's Package & Deployment Wizard or other installation apps, then upload that instead.
3. Usage of Resource files allows you to store any types of files with your project. Resource files have their own functions for extracting the stored information.