Solved

Propertybag doubts

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Exit a vb6 apps when a calling it apps closes 15 57
Advice in Xamarin 21 109
VB6 common control 6 sp6 object library not registerd 3 42
Problem to line 23 73
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…
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 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…

740 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