By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,714 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

need help with property bag equivalent in VB 2005...

P: 5
I created a simple user control: it's a label which hold a name for the meter (say, Hydraulic PSI) and a label, which hold the value. A meter is associated with a certain tag in OPC server and registered for data change. Let's assume that the meter displays value from 0 to 1000. When an operator clicks on the meter, a preference form pops up with color picker and the operator can select alarm colors for certain range. For example: if the pressure is between 0 and 100, he wants the label to be green, from 100 to 700 the label should be blue (let's say it's normal operation) and over 700 the label should change color to red.
It works all fine, and an operator can chose the alarm colors and ranges, but once the application is closed and restarted, the alarms are gone.
I tried to follow example in the help in vb 2005, creating a serializable class and then write them to a file, but, the problem is that the file name doesn't change and it gets overriten with every new meter on the form. In addition, I can have the same meter on different form, so the tag name from OPC server doesn't do me any good as, in this case I'll have two files with the same name.
In VB6 I used to loop through the meters and write/read their property bags, but VB 2005 makes my life a little bit miserable.
I don't know if it's enough info from me. I haven't tried anything besides trying to write it to a file. I guess I just don't know where to start...

Thanks
---------------------------------------------------

I used to be indecisive, but now... I'm not so sure
Sep 17 '07 #1
Share this Question
Share on Google+
1 Reply


Dököll
Expert 100+
P: 2,364
Nicely detailed message, vsavin!

I am not too savvy in VB 2005 just yet, but you will find if you post the area you are having issues with, and stay tuned, you'll get sound results. If nothing, still ask questions, will attempt to Google it and see what happens...

In a bit:-)
Sep 18 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.