?
Solved

Propertybag doubts

Posted on 1998-04-14
2
Medium Priority
?
289 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 40 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Suggested Courses
Course of the Month12 days, 20 hours left to enroll

777 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