property Items.StartUpdateLink (LinkKey as Variant) as Long
Starts changing properties of the link, so EndUpdateLink method adds programmatically updated properties to undo/redo queue.

 TypeDescription 
   LinkKey as Variant A VARIANT expression that specifies the key of the link being updated. Use the AddLink method to add programmatically new links between bars.  
   Long A Long expression that specifies the handle to be passed to EndUpdateLink so the updated properties of the link are added to the Undo/Redo queue of the chart, so they can be used in undo/redo operations.  
Use the StartUpdateLink and EndUpdateLink methods to add new entries in the chart's undo/redo queue for properties of the link being updated by code. The Link property accesses the properties of the link. For instance, if your application provides UI dialogs or forms that help users changing the properties of the selected link such as color, text, tooltips and so on, you can provide undo/redo operations for them by using the StartUpdateLink and EndUpdateLink methods. Shortly, the StartUpdateLink method starts recording the properties being changed until the EndUpdateLink method is called. The EndUpdateLink method actually adds a new entry to the undo/redo queue based on the changed properties. If there were no changes of the link during the Star/End session, no new entry is added. The EndUpdateLink method adds UpdateLink entries to the undo/redo queue. 

The AllowUndoRedo property specifies whether the chart supports undo/redo operations for objects in the chart such as bars or links. The ChartStartChanging(exUndo/exRedo) / ChartEndChanging(exUndo/exRedo) event notifies your application whenever an Undo/Redo operation is performed. The UndoListAction property lists the Undo actions that can be performed in the chart. The RedoListAction property lists the Redo actions that can be performed in the chart.

The following VB sample adds a new entry "UpdateLink" in the chart's undo/redo queue for changing the text being displayed on the link ( /COM version ):

With G2antt1.Items
    Dim linkKey As Variant
    linkKey = .FirstLink
    Dim iChangeLink As Long
    iChangeLink = .StartUpdateLink(linkKey)
    .Link(linkKey, exLinkText) = "new text"
    .EndUpdateLink (iChangeLink)
End With

The following VB/NET sample adds a new entry "UpdateLink" in the chart's undo/redo queue for changing the text being displayed on the link ( /NET Assembly version ):

With Exg2antt1.Items
    Dim linkKey As Object = .get_FirstLink
    Dim iChangeLink As Long = .get_StartUpdateLink(linkKey)
    .set_Link(linkKey, exontrol.EXG2ANTTLib.LinkPropertyEnum.exLinkText, "new text")
    .EndUpdateLink(iChangeLink)
End With

These samples add new entries to undo/redo queue as : "UpdateLink;L1;12;;new text " which indicates , the link as being L1, the 12 indicates the exLinkText predefined value, and so on. Once the sample is called, the link's text is changed, and using the CTRL + Z, you can restore back the old value, or pressing the CTRL + Y you can change back after restoring.

 

 


Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.