Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Property Page changes not saving
Message
 
À
17/04/1999 17:38:37
Information générale
Forum:
Visual Basic
Catégorie:
Contrôles ActiveX
Divers
Thread ID:
00209422
Message ID:
00209484
Vues:
17
>I'm having a problem with a custom control I designed. If the user modifies properties of the control via the VB Property window, VB properly fires the control's WriteProperties event. But if the user modifes the control using the Property Page I designed for it, then VB never calls the WriteProperties event. The control does update properly on the form, but if you close the form and reopen it, the changes to the control are gone (since they weren't saved). The changes do get saved if, after using the property page, the user modifes a property via the VB Property window. So I know the control is being updated, it's just that VB isn't firing the WriteProperties event if the only changes were through the Property Page.
>
>What could I be doing wrong in the Property Page the would cause VB to not realize the control had changed?

This is VB behavior!

When you are in the VB Environment and set properties (don't forget to use PropertyChanged method), the WriteProperties event will be called automatically and your new settings will be saved in a code module (a form for example).

When your user use your application and change properties, new values cannot be saved to the code module since they don't have them!

One suggestion: In the WriteProperties event check the UserMode property. If you are in the VB IDE, use the Property bag as you already did. If you are in runtime, save properties to the registry (when you load the form, don't forget to read registry values)! The thing I didn't test is if ReadProperties and WriteProperties events are triggered at run-time.

I am interested in your results!
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform