Type | Description | |||
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. |
Use the ItemBar(exBarStart) and ItemBar(exBarEnd)/ItemBar(exBarEndInclusive) 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.
Syntax for BarResizing event, /NET version, on:
private void BarResizing(object sender,int Item,object Key) { } Private Sub BarResizing(ByVal sender As System.Object,ByVal Item As Integer,ByVal Key As Object) Handles BarResizing End Sub |
private void BarResizing(object sender, AxEXG2ANTTLib._IG2anttEvents_BarResizingEvent e) { } void OnBarResizing(long Item,VARIANT Key) { } void __fastcall BarResizing(TObject *Sender,Exg2anttlib_tlb::HITEM Item,Variant Key) { } procedure BarResizing(ASender: TObject; Item : HITEM;Key : OleVariant); begin end; procedure BarResizing(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_BarResizingEvent); begin end; begin event BarResizing(long Item,any Key) end event BarResizing Private Sub BarResizing(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_BarResizingEvent) Handles BarResizing End Sub Private Sub BarResizing(ByVal Item As EXG2ANTTLibCtl.HITEM,ByVal Key As Variant) End Sub Private Sub BarResizing(ByVal Item As Long,ByVal Key As Variant) End Sub LPARAMETERS Item,Key PROCEDURE OnBarResizing(oG2antt,Item,Key) RETURN |
<SCRIPT EVENT="BarResizing(Item,Key)" LANGUAGE="JScript"> </SCRIPT> <SCRIPT LANGUAGE="VBScript"> Function BarResizing(Item,Key) End Function </SCRIPT> Procedure OnComBarResizing HITEM llItem Variant llKey Forward Send OnComBarResizing llItem llKey End_Procedure METHOD OCX_BarResizing(Item,Key) CLASS MainDialog RETURN NIL void onEvent_BarResizing(int _Item,COMVariant _Key) { } function BarResizing as v (Item as OLE::Exontrol.G2antt.1::HITEM,Key as A) end function function nativeObject_BarResizing(Item,Key) return |
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.
If using the SchedulePDM method during a BarResizing event, you can see the order of the events in the following VB sample:
Private Sub G2antt1_BarResize(ByVal Item As EXG2ANTTLibCtl.HITEM, ByVal Key As Variant) Debug.Print "BarResize invoked" End Sub Private Sub G2antt1_BarResizing(ByVal Item As EXG2ANTTLibCtl.HITEM, ByVal Key As Variant) Debug.Print "BarResizing invoked" G2antt1.Items.SchedulePDM Item, Key End Sub Private Sub G2antt1_ChartStartChanging(ByVal Operation As EXG2ANTTLibCtl.BarOperationEnum) If (Operation = exPDM) Then Debug.Print "SchedulePDM starts" End If End Sub Private Sub G2antt1_ChartEndChanging(ByVal Operation As EXG2ANTTLibCtl.BarOperationEnum) If (Operation = exPDM) Then Debug.Print "SchedulePDM ends" End If End SubThe output shows as follows:
BarResizing invoked SchedulePDM starts BarResize invoked BarResize invoked SchedulePDM ends BarResize invoked