Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: VB
Dear all
I have developed a program which runs absolutely fine.
Now i want to be able to change the form's image at run time but that should remain as default (permanently)even after closing the program.
I did try using common dialog to set form's image but as soon as i close the program the image is gone.
Please help me
Thank you in advance.
I am using the following code
common dialog1.ShowOpen
Form1.Picture = LoadPicture(common dialog1.FileName)
thank you
Posted 10-Nov-12 22:30pm
sarfarazbhat at 12-Nov-12 4:03am
Hello Sir I have a problem in Data report in vb6 with access 2007. Actually I want to calculate the sum of rate field of selected records and show the sum on label in section 5 of the data report. I did try but no success. I am using the following code. Collapse | Copy Code rs.Open "select * from patients where Receipt_date=#" & Label3.Caption & "#and investigation= '" & Combo1.Text & "'", Con, adOpenDynamic, adLockPessimistic ' DataReport1.Show DataReport1.Sections(5).Controls("label17").Caption = ("select sum(rate) from patientswhere Receipt_date=#" & Label3.Caption & "#and investigation= '" & Combo1.Text & "'" & "") Set DataReport1.DataSource = rs DataReport1.Refresh DataReport1.Show

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

If you want to make a change permanent, without altering the source code each time the image changes, then you need to store the image path in a file outside the application, and restore it when you load the program.
There are a huge number of ways you can do this, fvrom registry, to INI files, to databases, to date files, but this might be a simple way for you to do it:[^]
The only thing I would suggest is not to do what the author suggests as regards where to store the data: he stores it in the Application directory, which is not a good idea as on Vista and above there is a very good chance you won't have write access to that folder when you install your program properly. There is an Tip here that explains better places: Where should I store my data?[^]
sarfarazbhat at 12-Nov-12 4:01am
Thank you very much sir. Sarfaraz
OriginalGriff at 12-Nov-12 4:12am
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Dnyaneshwar@Pune 994
1 Sergey Alexandrovich Kryukov 826
2 OriginalGriff 448
3 Tadit Dash 390
4 sanket saxena 323
0 Sergey Alexandrovich Kryukov 11,800
1 OriginalGriff 7,225
2 Peter Leow 5,009
3 Abhinav S 3,893
4 Maciej Los 3,575

Advertise | Privacy | Mobile
Web03 | 2.8.140421.2 | Last Updated 11 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid