Solved

Propertybag doubts

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

691 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