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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vsavin
    New Member
    • Oct 2006
    • 5

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

    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
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    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:-)

    Comment

    Working...