Link to home
Start Free TrialLog in
Avatar of emi_sastra
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.
Avatar of Toxacon
Toxacon
Flag of Finland image

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.
Avatar of emi_sastra
emi_sastra

ASKER

Hi Toxacon,

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\PhotosUnlimited\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\SoftwareUnlimited\PhotosUnlimited\1.0\UserPreferences
HKCU\Software\SoftwareUnlimited\PhotosUnlimited\1.0\ImageGallery
HKCU\Software\SoftwareUnlimited\PhotosUnlimited\1.0\FormData

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.
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.
XML is the best to store those information ?

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.
I want to learn from the experts.

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
Avatar of Toxacon
Toxacon
Flag of Finland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Toxacon,

I am sorry, just back again.

It works.

Thank you very much for your help.