Trigger event when property value is changed

Started by ebachs10, January 17, 2020, 10:14:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ebachs10

Hi All,

Is it possible to autmatic trigger an event when a property value changes?
To be more specific, I want to modify the drop-down list of my ElectricalTypeList, when the ConnectedTo property changes, see attached picture.

Thanks in advance.

/Esben

Croc

Here is one of the variants for creating a two-level list.

Croc

#2
Sorry, but I was inattentive, so I brought a solution for ShapeSheet. :(
If we talk about events, then you can use the Visio Event Monitor add-on (from the Visio SDK). Event Monitor shows that when you select ShapeData from the list, only two events occur: FormulaChanged and CellChanged. They work. But these events have a drawback - they happen too often.
Another option is to use the QUEUEMARKEREVENT function and handle the app_MarkerEvent event. I like this option more.

More details:
Scratch.A1=QUEUEMARKEREVENT("MyCustomNotification")+DEPENDSON(Prop.Property1)

Dim WithEvents app As Visio.Application

Sub Start()
    Set app = ActiveDocument.Application
End Sub

Private Sub app_MarkerEvent(ByVal app As IVApplication, ByVal SequenceNum As Long, ByVal ContextString As String)
    MsgBox app.ActiveWindow.Selection(1).NameID & ": " & app.ActiveWindow.Selection(1).Cells("Prop.Property1").ResultStr(0)
End Sub

ebachs10

Hi Croc

Just what I was looking for! I will try to implement and test your suggestion :)

/Esben

Croc

During this time, I managed to write an article on my blog. This is a Russian-language blog, but you can use GoogleTranslate.
https://visioport.ru/blog/index.php/primery/26-list2level
It will be better if you will take the formulas from the article. They are more accurate.