Click here to Skip to main content
Rate this: bad
good
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
Comments
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
good
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: http://www.vb6.us/tutorials/store-data-resource-files-visual-basic-does[^]
 
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?[^]
  Permalink  
Comments
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 Nirav Prabtani 268
1 OriginalGriff 217
2 Mika Wendelius 185
3 _Amy 170
4 CPallini 170
0 Nirav Prabtani 284
1 OriginalGriff 217
2 Mika Wendelius 185
3 _Amy 170
4 CPallini 170


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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100