Solved

Propertybag doubts

Posted on 1998-04-14
2
279 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

759 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now