event BarResizing (Item as HITEM, Key as Variant)
Occurs when a bar is moving or resizing.

 TypeDescription 
   Item as HITEM A long expression that specifies the item that hosts the bar being moved or resized.  
   Key as Variant A VARIANT expression that specifies the bar being moved or resized.  
The BarResizing event is fired continually while the bar is resizing or moving. The BarResized event notifies the application once the bar is moved or resized. Use the ItemBar(exBarStart) and ItemBar(exBarEnd) properties to determine the start and end point of the bar being moved or resized. Use the ItemBar(exBarDuration) and ItemBar(exBarDurationPrev) properties to determine the duration after resizing, and before the bar being resized, so you can determine whether the user resizes or moves a bar. The ChartStartChaning(exMoveBar) event notifies the application once the user starts moving a bar, while the ChartEndChaning(exMoveBar) notifies the application once the user moved the bar. The ChartStartChaning(exResizeStartBar) or ChartStartChaning(exResizeEndBar) event notifies the application once the user starts resizing a bar, while the ChartEndChaning( exResizeStartBar) or ChartEndChaning(exResizeEndBar) notifies the application once the user resized the bar.

The following VB sample moves the bar in a second gantt control once the user resizes or moves a bar in the first gantt control:

Private Sub G2antt1_BarResizing(ByVal Item As EXG2ANTTLibCtl.HITEM, ByVal Key As Variant)
    With G2antt2
        .BeginUpdate
        .Items.AddBar .Items.ItemByIndex(G2antt1.Items.ItemToIndex(Item)), G2antt1.Items.ItemBar(Item, Key, exBarName), G2antt1.Items.ItemBar(Item, Key, exBarStart), G2antt1.Items.ItemBar(Item, Key, exBarEnd)
        .EndUpdate
    End With
End Sub

The sample uses the AddBar method instead ItemBar, so the start and end points of the bar are updated once.


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