Solved

Propertybag doubts

Posted on 1998-04-14
2
284 Views
Last Modified: 2012-06-22
dear sir,

l've been finding in the help and online books about the usage of property bag,
l'm now know what is the usage of property bag, but l really realy dont have
idea to start. The code in the online books is just a part of the property bag.
can anyone send me a sample code ?
here is my email : godace@rocketmail.com

Have a nice day..

thanks

John
0
Comment
Question by:EddieAng
2 Comments
 
LVL 8

Expert Comment

by:Kobe_Lenjou
ID: 1461165
I'll post some code tonight at home (in about 12 hours); if no1 has done it before me :-)
0
 
LVL 6

Accepted Solution

by:
anthonyc earned 10 total points
ID: 1461166
basically, you use the property bag in the WriteProperties and ReadProperties events of the usercontrol to save design time properties assigned to your control.  basically, you can call the properties whatever you like (although it would be best if you call them the same as the property let/get procedures you made)  

To write a property, you need to do 2 things...

1)  In the property let/get procedure, once you change the value, call the PropertyChanged method.  


PropertyChanged "YourPropName"

This tells VB the property changed, and you need to save it when you close

2)  In the writeproperties event, do this

propbag.writeproperty "YourPropName", m_YourPropValue, "YourPropDefault"



For reading properties, in the readproperties event do this

m_YourPropValue = propBag.readproperty("YourPropName", "YourPropDefault")

0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question