emi_sastra
asked on
ALLOW USER TO CHANGE PICTURE FROM FOLDER
Hi All,
I have windows application.
I want to allow user to change picture from shown picturebox.
Next time the form called again, it remains the new one changed by user.
How could I do it ?
Thank you.
I have windows application.
I want to allow user to change picture from shown picturebox.
Next time the form called again, it remains the new one changed by user.
How could I do it ?
Thank you.
You need to store information about the selected image/picture somewhere (in registry, for example). Next time the user starts the application, it reads the stored information and selects displayed image/picture accordingly.
ASKER
Hi Toxacon,
There will be a lot of things like that.
How we organize it at registry ?
Thank you.
There will be a lot of things like that.
How we organize it at registry ?
Thank you.
This is what to do:
Let's say you have company "Software Unlimited Inc" and your software is called "Photos Unlimited 1.0"
You'd create a key in Software\SoftwareUnlimited \PhotosUnl imited\1.0
Under that key you store values like String: "SelectedImage" Value: "Image003"
Per-user settings go to HKEY_Current_User (HKCU), so use this for user selections. Users can write to their own registry key.
Of course, if your software has multiple portions you can add additional registry keys to use to sort data:
HKCU\Software\SoftwareUnli mited\Phot osUnlimite d\1.0\User Preference s
HKCU\Software\SoftwareUnli mited\Phot osUnlimite d\1.0\Imag eGallery
HKCU\Software\SoftwareUnli mited\Phot osUnlimite d\1.0\Form Data
Let's say you have company "Software Unlimited Inc" and your software is called "Photos Unlimited 1.0"
You'd create a key in Software\SoftwareUnlimited
Under that key you store values like String: "SelectedImage" Value: "Image003"
Per-user settings go to HKEY_Current_User (HKCU), so use this for user selections. Users can write to their own registry key.
Of course, if your software has multiple portions you can add additional registry keys to use to sort data:
HKCU\Software\SoftwareUnli
HKCU\Software\SoftwareUnli
HKCU\Software\SoftwareUnli
ASKER
Which one will be the best.
1. Registry
2. Files or Database.
What will be happened when the computer is going to formatted ?
Thank you.
1. Registry
2. Files or Database.
What will be happened when the computer is going to formatted ?
Thank you.
It depends...
Registry pros:
- Easy to use
Registry cons:
- Difficult to transfer
Simple file pros:
- Easy to transfer
Simple file cons:
- Need to develop a settings parser
XML file pros:
- Standardized
- Easy to transfer
XML file cons:
- No?
Database pros:
- Central place to store settings
Database cons:
- Requires network connection
If the disk is formatted, the registry data will be gone. A file can be put on user's home directory on a server so it will survive formatting. A central database will also work that way.
Registry pros:
- Easy to use
Registry cons:
- Difficult to transfer
Simple file pros:
- Easy to transfer
Simple file cons:
- Need to develop a settings parser
XML file pros:
- Standardized
- Easy to transfer
XML file cons:
- No?
Database pros:
- Central place to store settings
Database cons:
- Requires network connection
If the disk is formatted, the registry data will be gone. A file can be put on user's home directory on a server so it will survive formatting. A central database will also work that way.
ASKER
XML is the best to store those information ?
Thank you
Thank you
Yes, if you know how to construct classes to store information. You can quite easily write contents of a class to XML file and vice versa.
ASKER
I want to learn from the experts.
Would you please provide code for me?
Thank you.
Would you please provide code for me?
Thank you.
Do you know how to create your own classes or do you need only the XML Reader/Writer code?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Toxacon,
I am sorry, just back again.
It works.
Thank you very much for your help.
I am sorry, just back again.
It works.
Thank you very much for your help.