Author Topic: Message Display by value having multiple controls reading from one collection  (Read 3128 times)

ms_sscc

  • Newbie
  • *
  • Posts: 7
    • View Profile
I have a form with 10 Message Displays By Value controls.  They all have the same values and strings in the collection.
 What I am trying to do is have a collection or list or string to load into a for loop to add the items to each of the 10 MDBV controls.
Something like this

Dim Mdv10StgArray As Collection
        LATest1.Text = MDV_10.Value
        LATest2.Text = MDV_10.ShowMessageNumber
this where I get stuck I don't know how to get the .Messages Into?

        Mdv10StgArray.Item = MDV_10.Messages.Item

Thanks,
 Matt

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
An easy way to do this that may work for you is to use the IniFileName property.

- Right click the AdvancedHMI project in Solution Explorer and select Add New Item
- Select Text File and give it a name like Alarms.txt
- After it s added, select the new file in Solution Explorer
- In the properties for that file change CopyToOutputDirector to CopyIfNewer
- In the file add:

0, No Alarms
1, My first Alarm
2, Next alatm

- Go back to the form with the MessageDisplayByValue
- Select your MessageDisplayByValue
- Set the IniFileName property to the name of the text file you created

You can set all of the MessageDisplayByValue to the same file. When the app starts, they will all load the same messages

ms_sscc

  • Newbie
  • *
  • Posts: 7
    • View Profile
Wow Thanks Archie... You get answer back so quick.  I will try this