constants ItemBarPropertyEnum
The ItemBarPropertyEnum type specifies a property related to a bar inside an item. Use the ItemBar property to retrieve or sets a value for bars in the item. The AllowCellValueToItemBar property allows the cells to display properties of the bars. The ShowLinksColor property specifies the color for links that starts or ends on selected bars. The ShowLinksStyle property specifies the width to show the links when the link starts from selected bar, ends on selected bar, or when it is not related to any of selected bars. The SelBarColor property specifies the color to display the selected bars.

The ItemBarPropertyEnum type  supports the following values:

 NameValueDescription 
   exBarName0 Retrieves or sets a value that indicates the name of the bar. The name of the bar does not indicate the bar's caption as exBarCaption property. Use the exBarName property to specify the type of the bar being shown. The BarName parameter of the AddBar method indicates the name of the bar being added. Use the Add method to add new type of bars to your chart. (String expression)  
   exBarStart1 Retrieves or sets a value that indicates the start of the bar. The DateStart parameter of the AddBar method indicates the start of the bar being added.  Use the exBarStart property to changes the starting point of the bar. DATE expression, including a String expression that defines the date. Use the ShowEmptyBars property to show the bars, even if the start and end dates are identical. Use the exBarMove or exBarDuration to move or resize programmatically the bar. Use the exBarStartPrev property to get the starting date before resizing the bar. If you need to change both start and end points of the bar in the same time, you can call the AddBar method with the new coordinates, same item and key. (Date expression)  
   exBarEnd2 Retrieves or sets a value that indicates the end of the bar. The DateEnd parameter of the AddBar method indicates the end of the bar being added. Use the exBarStart property to changes the ending point of the bar. DATE expression, including a String expression that defines the date. Use the ShowEmptyBars property to show the bars, even if the start and end dates are identical. Use the exBarMove or exBarDuration to move or resize programmatically the bar. Use the exBarEndPrev property to get the ending date before resizing the bar. If you need to change both start and end points of the bar in the same time, you can call the AddBar method with the new coordinates, same item and key. (Date expression)  
   exBarCaption3 Retrieves or sets a value that indicates the caption being assigned to the bar. The Text parameter of the AddBar method indicates the caption of the bar. Use the exBarHAlignCaption and exBarVAlignCaption to specify the alignment of the bar's caption. This option supports built-in HTMLformat. Use the exBarExtraCaption option to specify additional labels or captions for the bar. Use the Add method to associate a note with a bar. (String expression)  
   exBarHAlignCaption4 Retrieves or sets a value that indicates the horizontal alignment of the caption inside the bar. Use the exBarHAlignCaption property to align horizontally the caption being displayed between exBarStart and exBarEnd. 
  • If the exBarHAlignCaption property is 0,1 or 2 the caption is not clipped and it is aligned to the left, center or right side of the bar.
  • If the exBarHAlignCaption property is 3, 4 or 5 the caption of the bar gets clipped to the bar area, else the caption is aligned to the left, center or right side of the bar.
  • If the exBarHAlignCaption property includes the AlignmentEnum.exHOutside the caption is displayed outside of the bar to the left or to the right. For instance, if the exBarHAlignCaption property is AlignmentEnum.LeftAlignment OR AlignmentEnum. exHOutside, the caption is displayed outside of the bar in the left side of the bar. If the exBarHAlignCaption property is AlignmentEnum.RightAlignment OR AlignmentEnum. exHOutside, the caption is displayed outside of the bar in the right side of the bar. 

By default, the exBarHAlignCaption is CenterAlignment. (AlignmentEnum expression)

 
   exBarVAlignCaption5 Retrieves or sets a value that indicates the vertical alignment of the caption inside the bar. Use the exBarHAlignCaption property to align vertically the caption being displayed between exBarStart and exBarEnd. If the exBarVAlignCaption property includes the VAlignmentEnum.exVOutside the caption is displayed outside of the bar at the top or bottom side of the bar. For instance, if the exBarVAlignCaption property is VAlignmentEnum.exTop OR VAlignmentEnum.exVOutside, the caption is displayed outside of the bar in the top side of the bar. If the exBarVAlignCaption property is VAlignmentEnum.exBottom OR VAlignmentEnum.exVOutside, the caption is displayed outside of the bar in the bottom side of the bar. By default, the exBarVAlignCaption is exMiddle. (VAlignmentEnum expression)  
   exBarToolTip6 Retrieves or sets a value that indicates the tooltip being shown when the cursor hovers the bar. The property supports built-in HTML format. Use the exBarToolTip property to assign a tooltip to a bar or to a text in the chart's area. Use the ShowToolTip method to show a tooltip at runtime for different parts of the chart.  (String expression)  
   exBarBackColor7 Retrieves or sets a value that indicates the background color for the area being occupied by the bar. Color expression. This option has effect only if the exBarBackColor property is not zero. The last 7 bits in the high significant byte of the color indicates the identifier of the skin being used. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the background's part. The exSummaryBarBackColor property specifies the background color for the portion occupied by the bar while it is hosted by a summary bar, while the exBarColor property specifies the bar's color.  (Color expression)  
   exBarForeColor8 Retrieves or sets a value that indicates the foreground color for the caption of the bar. Color expression. This option has effect only if the exBarBackColor property is not zero. (Color expression)  
   exBarKey9 Specifies key of the bar. The Key parameter of the AddBar method indicates the key of the bar. (Variant expression )  
   exBarCanResize10 Specifies whether the user can resize the bar. Use the BarsAllowSizing property to specify whether the control supports moving or resizing the bars. If the exBarCanResize is 0/False, the bar can not be resized. If the exBarCanResize is -1/True, the bar can be resized on both sides. If the exBarCanResize is 1, the bar can be resized on left side, and can not be resized on right. If the exBarCanResize is 2, the bar can be resized on right side, and can not be resized on left. The exBarSelectable specifies whether a bar is fixed to its position, in other words if it can be selected or not. ( Boolean/Long expression )  
   exBarCanMove11 Specifies whether the user can move the bar. Use the BarsAllowSizing property to specify whether the control supports moving or resizing the bars. Use the exBarCanMoveToAnother option to specify whether the user can move a bar from one item to another by drag and drop. The exBarSelectable specifies whether the bar can be selected at runtime. ( Boolean expression )  
   exBarPercent12 Specifies the percent from the original bar where the progress bar is displayed. This float value should be between 0 and 1 ( 1 means 100% ). You can use also the exBarpercent100 to specify long expression value from 0 to 100. Use the Add("A%B") to add a combination of two bars, so the exBarPercent value specifies the percent from the bar A to be displayed as bar B. For instance, the Add("Task%Progress") adds a combination of Task and Progress bars, so the Task shape is displayed on the full bar, and the Progress shape is displayed only on the portion determined by the exBarPercent value. When you resize the original bar (A), the inside bar (B) is shown proportionally. Use the exBarShowPercentCaption option to show the percent value as caption on the bar. Use the exBarPercentCaptionFormat property to define the format of the percent value being displayed as text. Use the exBarAlignmentPercentCaption property to specify the alignment of the percent on the bar. The BarResize event is fired when the exBarPercent value is changed. You can use the exBarPercent100 option to work with integer values from 0 to 100 for specifying the bar's percent.  The 0 value corresponds to the exBarStart, while 1 corresponds to the exBarEnd, so the formula Items.ItemBar(exBarStart) + (Items.ItemBar(exBarEnd)-Items.ItemBar(exBarStart))*Items.ItemBar(exBarPercent) gives exactly the date time where progress bar is in the chart. ( Float expression, between 0 and 1, by default it is 0 )  
   exBarPercentCaptionFormat13 Specifies the HTML format to be displayed as percent. The percent is displayed on the bar only if the exBarShowPercentCaption option is True. By default, the exBarPercentCaptionFormat property is "<b>%p%</b>" where the %p is the value of the percent ( exBarPercent property ), and it displays the percent as 15%, where exBarPercent is 0.15. The <b> indicates that the text is bolded. (String expression)  
   exBarShowPercentCaption14 Specifies whether the percent is displayed as caption on the bar. By default, the exBarShowPercentCaption property is False, which means that the percent value is not shown. Use the exBarPercent property to specify the value of the percent. Use the exBarPercentCaptionFormat property to define the format of the percent being displayed on the bar. Use the exBarAlignPercentCaption property to indicates the alignment of the percent in the bar. (Boolean expression)  
   exBarAlignPercentCaption15 Specifies the alignment of the percent caption on the bar. By default, the exBarAlignmentPercentCaption property is RightAlignment, that indicates that the percent value is displayed to the right. (AlignmentEnum expression)  
   exBarCanResizePercent16 Specifies whether the user can resize the percent at runtime. By default, the exBarCanResizePercent is True. Here's how the user can resize the percent value at runtime. Move the mouse to the last portion of the percent, so the Percent cursor is shown. Click and drag the bar to a new position, so the exBarPercent value is defined proportionally by the position of the cursor in the original bar. The BarResize event is fired when the user changes the percent value at runtime. (Boolean expression)  
   exBarData17 Associates an extra data to a bar. Use this property to assign your extra data to any bar in the item.  (Variant expression)  
   exBarOffset18 Specifies the vertical offset where the bar is shown. By default, this property is 0 and the bar is shown in the center. Use this property to show up or down the bar. Use the OverlaidType property to specify how two or more bars that cross over are displayed.  (Long expression)  
   exBarTransparent19 Specifies the percent of the transparency to display the bar, or to show or hide a bar and its links. By default, this property is 0, which means that the bar is opaque. If the property is 50, the bar is shown semi-transparent.  Use the ShowTransparentBars property to draw all bars using a semi- transparent color. Use the OverlaidType property to specify how two or more bars that cross over are displayed. If the exBarTransparent property is 100, the bar is hidden, along with its links if any. ( Long expression between 0-opaque, 50-semi-transparent100-hidden ).  
   exBarKeepWorkingCount20 Specifies a value that indicates whether the bar keeps constant the working units, while the user moves the bar to a new position. The NonworkingDays property specifies the non-working days. Use the AddNonworkingDate property to add custom non-working days. Use the NonworkingHours property to specify the non-working hours. The exBarWorkingCount option specifies the number of working units being unchanged. This option is ignored for summary bars or exBarTreatAsNonworking bars. (Boolean expression)  
   exBarEffort21 (exBarEffort/21) By default, the exBarEffort is 1 ( double expression ). Specifies the effort to execute an unit in the task. This property has effect only when the bar is represented in the chart's histogram. Use the HistogramVisible property to specify whether the control shows the chart's histogram. Changes the HistogramPattern or/and HistogramColor property, else no bars will be shown in the histogram.

The representation of the exBarEffort value depends on the HistogramType property as follow:

  • exHistOverload, the exBarEffort value represents the effort to execute an unit in the bar. For instance, if the bars display activities the exBarEffort value may represent the number of workers for each activity so the overload histogram displays the total number of workers on the activity.

The following screen shot shows the exHistOverload histogram when exBarEffort property is 1 ( by default ):

The following screen shot shows the exHistOverload histogram when exBarEffort property is different for bars as seen in the columns section: 

 

  • exHistOverAllocation, the exBarEffort value defines the workload to show in the exHistOverAllocation histogram. The work-load for a task is computed as exBarEffort / length of the bar. The work-load for the task is the work effor / task duration. (i.e. If  item.exBarEffort = 1 and gantt bar length is 10 days, then the work-load = 0.1 or 10%). The histogram- graph shows the sum of the work-loads (the work-load of each task item is added, unit by unit). 

The following screen shot shows the exHistOverallocation histogram when exBarEffort property is 1 ( by default ):

The following screen shot shows the exHistOverallocation histogram when exBarEffort property is different for bars as seen in the columns section: 

(Float expression)

 
   exBarMinStart22 Specifies the minimum value for the starting date of the bar. Use this value to limit bar to move in a specified range. Use the exBarMinDuration and exBarMaxDuration properties to specify the limits for the bar's duration.  ( Date expression )  
   exBarMaxStart23 Specifies the maximum value for the starting date of the bar. Use this value to limit bar to move in a specified range. Use the exBarMinDuration and exBarMaxDuration properties to specify the limits for the bar's duration.  ( Date expression )  
   exBarMinEnd24 Specifies the minimum value for the ending date of the bar. Use this value to limit bar to move in a specified range. Use the exBarMinDuration and exBarMaxDuration properties to specify the limits for the bar's duration.  ( Date expression )  
   exBarMaxEnd25 Specifies the maximum value for the ending date of the bar. Use this value to limit bar to move in a specified range. Use the exBarMinDuration and exBarMaxDuration properties to specify the limits for the bar's duration.  ( Date expression )  
   exBarShowRange26 Indicates whether the bar shows its range where it can be moved or resized. It indicates a PatternEnum expression that specifies the way to mark the range of the bar, or a skin identifier to be used for showing the range. (Boolean expression)  
   exBarShowRangeTransparent27 Specifies the percent of the transparency to display the range of the bar. By default this property is 0. ( Long expression, from 0 to 100, where 100 means fully transparent )  
   exBarCanMoveToAnother28 By default, the bar can NOT be moved from an item to another. Specifies whether the bar can be moved to another item by drag and drop. Use the exBarPercent property to change the parent item of the bar by code. In order to move a bar from one item to another using the drag and drop operations, this option MUST be set on True. The control fires the BarParentChange event just before moving the bar to another item. Use this event to control the items where your bar can be moved. A bar can be moved to another item, ONLY if the second item does not contain a bar with the same key. The exBarKey property specifies the key of the bar. (Boolean expression)  
   exBarSelectable29 Specifies whether the bar can be selected. The exBarCanMove specifies whether a bar can be moved at runtime. The exBarCanResize specifies whether a bar can be resized at runtime. The exBarSelectable specifies whether a bar is fixed to its position. ( Boolean expression )  
   exBarCanStartLink30 Specifies whether a link can start from this bar. By default, the exBarCanStartLink is True. The exBarCanStartLink option has effect only if the exBarCanBeLinked option is True. You can control enabling or disabling links at runtime using the AllowLink event.   ( Boolean expression )  
   exBarCanEndLink31 Specifies whether a link can end on this bar. . By default, the exBarCanEndLink is True. The exBarCanEndLink option has effect only if the exBarCanBeLinked option is True. You can control enabling or disabling links at runtime using the AllowLink event.   ( Boolean expression )  
   exBarCanBeLinked32 Specifies whether the bar can be linked. . By default, the exBarCanBeLinked is True. You can control enabling or disabling links at runtime using the AllowLink event.  ( Boolean expression )  
   exBarColor33 Specifies the color for a particular bar. If used, it replaces the bar's type color. By default, the exBarColor is 0, which means that the default bar's color is used. The Color property defines the default's bar color.  The Color property defines the color for all bars of the same type. Use the exBarColor to change the color for particular bars. As usual, this option may indicates a skin object to display the bar. If the EBN identifier (last 7 bits in the high significant byte of the color) is not specified(0), but the Color property indicates an EBN object, the exBarColor specifies the color to apply to the EBN object. The exBarOverviewColor option may be used to specify the color within the overview part of the control. The HistogramCumulativeOriginalColorBars property indicates whether the bars that generate the histogram change their original color. If available, you can change the bar's pattern using the exBarPattern option. ( Color expression ).  
   exSummaryBarBackColor34 Specifies the item's background color for child bars owned by the summary bar. The last 7 bits in the high significant byte of the color indicates the identifier of the skin being used. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the background's part. The DefineSummaryBars property defines bars that belongs to a summary bar.

By default, the exSummaryBarBackColor property is 0, which means that it has no effect. 

If the exSummaryBarBackColor property is set to a non- zero value it indicates the background color for the portion of the summary bar as seen in the following screen shot:

The following screen shot shows the bars that belongs to a summary bars using EBN colors and semi-transparent (exSummaryBarBackColorTransparent = 50):

The exBarBackColor property specifies the background color for the portion occupied by the bar, while the exBarColor property specifies the bar's color.  (Color expression)

 
   exSummaryBarBackColorTransparent35 Specifies the percent of the transparency to display the background of the bars that belongs to a summary bar. By default, the exSummaryBarBackColorTransparent property is 0, which means opaque since 100 means fully transparent, and 50 means semi-transparent. The exSummaryBarBackColorTransparent property has effect only if the exSummaryBarBackColor property is not 0.  

The following screen shot displays the bars that belongs to a summary bar using a semi-transparent color ( so the non-working portion is visible )

(Long expression between 0-opaque, 100-transparent)

 
   exBarMinDuration36 Specifies the minimum duration of the bar in days . By default, the exBarMinDuration property is 0, which means that there is no lower limit, or the length of the bar can be any value. If the exBarMinDuration property is not 0, the duration of the bar must be greater than specified value, or in other words, the bar will not be shown with its duration less than exBarMinDuration value. Use the exBarDuration property to change the bar's duration. (double expression)  
   exBarMaxDuration37 Specifies the maximum duration of the bar in days. By default, the exBarMaxDuration property is -1, which means that there is no upper limit, or the length of the bar can be any value. If the exBarMaxDuration property is not -1, the duration of the bar must be less than specified value, or in other words, the bar will not be shown with its duration greater than exBarMaxDuration value. Use the exBarDuration property to change the bar's duration. (double expression)  
   exBarTreatAsNonworking38 Specifies whether the bar is treated as non-working part of the item. By default, the exBarTreatAsNonworking is False.

This option has effect only if:

  • AllowNonworkingBars property is True.
  • ItemNonworkingUnits property is not empty, and points to a valid expression. The ItemNonworkingUnits property indicates a repetitive expression to determine the parts of the item being non-working. 

In other words, the exBarTreatAsNonworking bars are treated as regular bars if the AllowNonworkingBars property is False, or if ItemNonworkingUnits property is empty (boolean expression).

 
   exBarPercentColor39 Specifies the color to show inside percent bar. The option is valid for bars that displays inside a percent bar. A bar can display a percent bar if it was creates using the Chart.Bars.Add("A%B") syntax. For instance Chart.Bars.Add("Task%Progress") adds a task bar that displays inside a percent bar. (Color expression)  
   exBarNonWorkingColor40 Specifies the color to show non-working parts of the bar. A bar may show different shape, pattern for non-working parts of the bar if it was previously created using the Bars.Add("A:B"). For instance the Bars.Add("Task:Split") adds a a bar that displays the split if it covers a non-working part.  (Color expression)  
   exBarOverviewColor41 Specifies the color to show the bar in the overview area. The OverviewVisible property specifies whether the control displays the overview/layout map of bars within the chart.

The color to specify the bar in the overview area is used as follows:

  • If exBarOverviewColor is not 0, the exBarOverviewColor indicates the color to show the bar in the overview area, else
  • If the exBarColor is not 0, the  exBarColor indicates the color to show the bar in the overview area, else
  • the Color property of the Bar indicates the color to show the bar in the overview part of the control.

(Color expression)

 
   exBarPattern42 By default the exBarPattern option is empty. If the exBarPattern property is empty, the option is ignored. Use the exBarPattern to specify a different pattern to be displayed on the bar in the chart area. The Pattern property of the Bar specifies the pattern to be applied for all bars of the same type. For instance, includes the exPatternFrameShadow in the bar's pattern to show a shadow around the bar. (PatternEnum expression)  
   exBarsCount256 Retrieves a value that indicates the number of bars in the item. The exBarsCount property counts the bars being displayed in the item. Use the AddBar property to add new bars to the item. (Long expression)  
   exBarSelected257 Specifies whether the bar is selected or unselected. By default, the exBarSelected is False. The AllowSelectObjects property allows users to select at runtime the bars and links in the chart area.  The ChartSelectionChanged event is fired when the selection in the chart is changed. (Boolean expression)  
   exBarWorkingCount258 Specifies the count of working units ( days ) in the bar. For instance, 1 indicates one working day, while 0.5 indicates 12 hours from a working day.  The NonworkingDays property specifies the non-working days. Use the AddNonworkingDate property to add custom non-working days. Use the NonworkingHours property to specify the non-working hours. Use the exBarWorkingCount property to specify the number of working days for a specified bar. For instance, if your chart displays days, and the NonworkingDays is set, the exBarWorkingCount property sets or gets the count of working days in the bar. If the chart displays hours, and the NonworkingHours property is set, the exBarWorkingCount property sets or gets the count of working hours in the bar. (Float expression)  
   exBarNonWorkingCount259 Specifies the count of non-working units ( days ) in the bar. For instance, 1 indicates one non-working day, while 0.5 indicates 12 hours from a non-working day. The NonworkingDays property specifies the non-working days. Use the AddNonworkingDate property to add custom non-working days. Use the NonworkingHours property to specify the non-working hours. For instance, if your chart displays days, and the NonworkingDays is set, the exBarNonworkingCount property gets the count of non-working days in the bar. If the chart displays hours, and the NonworkingHours property is set, the exBarNonWorkingCount property gets the count of non-working hours in the bar. (double expression)  
   exBarNonWorkingUnits260 Retrieves a collection of pairs ( start-end ) that indicates the non-working parts of the bar. You can use the exBarNonWorkingUnitsAsString property to get the non-working parts of the bar as a string. The /NET Assembly provides a get_BarNonWorkingUnits method that retrieves a collection of DateTime objects.

The following VB sample lists the start and end date-time values for non-working parts of the bar ( for the /COM version ):

Private Sub G2antt1_BarResize(ByVal item As EXG2ANTTLibCtl.HITEM, ByVal Key As Variant)
    Debug.Print "Non-working parts of the bar:"
    With G2antt1.Items
        Dim i As Variant, j As Long
        For Each i In .ItemBar(item, Key, exBarNonWorkingUnits)
            Debug.Print IIf(j Mod 2 = 0, "Start ", "End ") & i
            j = j + 1
        Next
    End With
End Sub

The following VB/NET sample lists the start and end date-time values for non-working parts of the bar ( for the /NET Assembly version ):

Private Sub Exg2antt1_BarResize(ByVal sender As System.Object, ByVal Item As System.Int32, ByVal Key As System.Object) Handles Exg2antt1.BarResize
    Debug.Print("Non-working parts of the bar:")
    With Exg2antt1.Items
        Dim i As Object, j As Long
        For Each i In .get_BarNonWorkingUnits(Item, Key)
            Debug.Print(IIf(j Mod 2 = 0, "Start ", "End ") & i)
            j = j + 1
        Next
    End With
End Sub

( safe array of pairs of dates indicating the start and end of the non-working area )

 
   exBarNonWorkingUnitsAsString261 Displays as string the collection of pairs ( start-end ) that indicates the non-working parts of the bar. The /NET Assembly provides a get_BarNonWorkingUnitsAsString method that retrieves the non-working parts of the bar as string

The following VB sample lists the start and end date-time values for non-working parts of the bar ( for the /COM version ):

Private Sub G2antt1_BarResize(ByVal item As EXG2ANTTLibCtl.HITEM, ByVal Key As Variant)
    Debug.Print "Non-working parts of the bar:"
    With G2antt1.Items
        Debug.Print .ItemBar(item, Key, exBarNonWorkingUnitsAsString)
    End With
End Sub

The following VB/NET sample lists the start and end date-time values for non-working parts of the bar ( for the /NET Assembly version ):

Private Sub Exg2antt1_BarResize(ByVal sender As System.Object, ByVal Item As System.Int32, ByVal Key As System.Object) Handles Exg2antt1.BarResize
    Debug.Print("Non-working parts of the bar:")
    With Exg2antt1.Items
        Debug.Print(.get_BarNonWorkingUnitsAsString(Item, Key))
    End With
End Sub

(String expression)

 
   exBarWorkingUnits262 Retrieves a collection of pairs ( start-end ) that indicates the working parts of the bar. You can use the exBarWorkingUnitsAsString property to get the working parts of the bar as a string. The /NET Assembly provides a get_BarWorkingUnits method that retrieves a collection of DateTime objects.

The following VB sample lists the start and end date-time values for working parts of the bar ( for the /COM version ):

Private Sub G2antt1_BarResize(ByVal item As EXG2ANTTLibCtl.HITEM, ByVal Key As Variant)
    Debug.Print "Working parts of the bar:"
    With G2antt1.Items
        Dim i As Variant, j As Long
        For Each i In .ItemBar(item, Key, exBarWorkingUnits)
            Debug.Print IIf(j Mod 2 = 0, "Start ", "End ") & i
            j = j + 1
        Next
    End With
End Sub

The following VB/NET sample lists the start and end date-time values for working parts of the bar ( for the /NET Assembly version ):

Private Sub Exg2antt1_BarResize(ByVal sender As System.Object, ByVal Item As System.Int32, ByVal Key As System.Object) Handles Exg2antt1.BarResize
    Debug.Print("Working parts of the bar:")
    With Exg2antt1.Items
        Dim i As Object, j As Long
        For Each i In .get_BarWorkingUnits(Item, Key)
            Debug.Print(IIf(j Mod 2 = 0, "Start ", "End ") & i)
            j = j + 1
        Next
    End With
End Sub

( safe array of pairs of dates indicating the start and end of the working area )

 
   exBarWorkingUnitsAsString263 Displays as string the collection of pairs ( start-end ) that indicates the working parts of the bar. The /NET Assembly provides a get_BarWorkingUnitsAsString method that retrieves the working parts of the bar as string.

The following VB sample lists the start and end date-time values for working parts of the bar ( for the /COM version ):

Private Sub G2antt1_BarResize(ByVal item As EXG2ANTTLibCtl.HITEM, ByVal Key As Variant)
    Debug.Print "Working parts of the bar:"
    With G2antt1.Items
        Debug.Print .ItemBar(item, Key, exBarWorkingUnitsAsString)
    End With
End Sub

The following VB/NET sample lists the start and end date-time values for working parts of the bar ( for the /NET Assembly version ):

Private Sub Exg2antt1_BarResize(ByVal sender As System.Object, ByVal Item As System.Int32, ByVal Key As System.Object) Handles Exg2antt1.BarResize
    Debug.Print("Working parts of the bar:")
    With Exg2antt1.Items
        Debug.Print(.get_BarWorkingUnitsAsString(Item, Key))
    End With
End Sub

(String expression)

 
   exBarExtraCaption264 Use the exBarExtraCaption property to assign multiple captions to a bar at once. Retrieves or sets a collection of extra captions being assigned to the bar. If a single extra caption is being added, you can use the caption, or if multiple you have to build a safe array of strings. By default, any extra caption is added to the center of the bar. Use the exBarExtraCaptionHAlign to specify the horizontal alignment of the extra caption being added. Use the exBarExtraCaptionHOffset to specify the horizontal offset to move the extra caption relative to its default position. Use the exBarExtraCaptionVAlign to specify the vertical alignment of the extra caption being added. Use the exBarExtraCaptionVOffset to specify the vertical offset to move the extra caption relative to its default position. The /NET assembly provides, the get_BarExtraCaption and set_BarExtraCaption properties to get and set the extra captions. Use the Add method to associate a note with a bar.

The following VB sample adds a single extra caption in the right side of the bar:

With G2antt1.Items
    .ItemBar(.FocusItem, .FirstItemBar(.FocusItem), exBarExtraCaption) = "right"
    .ItemBar(.FocusItem, .FirstItemBar(.FocusItem), exBarExtraCaptionHAlign) = RightAlignment Or exHOutside
End With

The following VB sample adds two extra captions, one in the left side, and one to the right side:

With G2antt1.Items
    .ItemBar(.FocusItem, .FirstItemBar(.FocusItem), exBarExtraCaption) = Array("left", "right")
    .ItemBar(.FocusItem, .FirstItemBar(.FocusItem), exBarExtraCaptionHAlign) = Array(LeftAlignment Or exHOutside, RightAlignment Or exHOutside)
End With

When retrieving the exBarExtraCaption returns the extra caption, if there is only, one, else it returns a safe arrea ( collection ) of string that indicates the extra captions of the bar.

The following VB/NET sample adds a single extra caption in the right side of the bar:

With Exg2antt1.Items
    .set_BarExtraCaption(.FocusItem, .get_FirstItemBar(.FocusItem), "right")
    .set_BarExtraCaptionHAlign(.FocusItem, .get_FirstItemBar(.FocusItem), exontrol.EXG2ANTTLib.AlignmentEnum.RightAlignment Or exontrol.EXG2ANTTLib.AlignmentEnum.exHOutside)
End With

The following VB/NET sample adds two extra captions, one in the left side, and one to the right side:

With Exg2antt1.Items
    .set_BarExtraCaption(.FocusItem, .get_FirstItemBar(.FocusItem), New String() {"left", "right"})
    .set_BarExtraCaptionHAlign(.FocusItem, .get_FirstItemBar(.FocusItem), _
    New exontrol.EXG2ANTTLib.AlignmentEnum() {exontrol.EXG2ANTTLib.AlignmentEnum.LeftAlignment Or exontrol.EXG2ANTTLib.AlignmentEnum.exHOutside, _
        exontrol.EXG2ANTTLib.AlignmentEnum.RightAlignment Or exontrol.EXG2ANTTLib.AlignmentEnum.exHOutside})
End With

The following C# sample adds a single extra caption in the right side of the bar:

exontrol.EXG2ANTTLib.Items items = exg2antt1.Items;
items.set_BarExtraCaption(items.FocusItem, items.get_FirstItemBar(items.FocusItem), "right");
items.set_BarExtraCaptionHAlign(items.FocusItem, items.get_FirstItemBar(items.FocusItem), exontrol.EXG2ANTTLib.AlignmentEnum.RightAlignment | exontrol.EXG2ANTTLib.AlignmentEnum.exHOutside);

The following C# sample adds two extra captions, one in the left side, and one to the right side:

exontrol.EXG2ANTTLib.Items items = exg2antt1.Items;
items.set_BarExtraCaption(items.FocusItem, items.get_FirstItemBar(items.FocusItem), 
    new string[2] { "left", "right" });
items.set_BarExtraCaptionHAlign(items.FocusItem, items.get_FirstItemBar(items.FocusItem), 
    new exontrol.EXG2ANTTLib.AlignmentEnum[2] { exontrol.EXG2ANTTLib.AlignmentEnum.LeftAlignment | exontrol.EXG2ANTTLib.AlignmentEnum.exHOutside, 
        exontrol.EXG2ANTTLib.AlignmentEnum.RightAlignment | exontrol.EXG2ANTTLib.AlignmentEnum.exHOutside });

( string expression or safe array of string expressions )

 
   exBarExtraCaptionHAlign265 Specifies the horizontal alignment for each extra caption assigned to the bar. ( AlignmentEnum expression, or a safe array of AlignmentEnum/long/vt_i4 expression)  
   exBarExtraCaptionVAlign266 Specifies the vertical alignment for each extra caption assigned to the bar. ( VAlignmentEnum expression, or a safe array of VAlignmentEnum/long/vt_i4 expression)  
   exBarExtraCaptionHOffset267 Retrieves or sets the offset to move horizontally the extra caption relative to its default position. ( long expression, or a safe array of long/vt_i4 expression)  
   exBarExtraCaptionVOffset268 Retrieves or sets the offset to move vertically the extra caption relative to its default position. ( long expression, or a safe array of long/vt_i4 expression)  
   exBarParent512 Specifies the handle of the parent item that displays the bar. The Item parameter of the AddBar method indicates the handle of the item that hosts the bar. Use the exBarCanMoveToAnother option to specify whether the user can move a bar from one item to another by drag and drop. The control fires the BarParentChange event just before moving the bar to another item. Use this event to control the items where your bar can be moved. A bar can be moved to another item, ONLY if the second item does not contain a bar with the same key. The exBarKey property specifies the key of the bar.  (Long expression)  
   exBarDuration513 Specifies the duration of the bar in days. Gets the difference between exBarEnd and exBarStart as a double expression. If calling the set property, it changes the bar's duration. If negative the start date is baed on the end - duration, since if it is positive, the end date is start + duration. The round part indicates the number of days. Use the exBarMove property to move programmatically a bar by specified time. If you need to change both start and end points of the bar in the same time, you can call the AddBar method with the new coordinates, same item and key. Use the exBarDurationPrev property to get the length or duration of the bar before resizing it. Use the exBarMinDuration and exBarMaxDuration properties to specify the limits for the bar's duration.  ( Float expression )  
   exBarMove514 Moves the bar inside the same item by specified amount of time. If you need to change both start and end points of the bar in the same time, you can call the AddBar method with the new coordinates, same item and key. The exBarParent changes the bar's parent. Use the exBarCanMoveToAnother option to specify whether the user can move a bar from one item to another by drag and drop. ( Float expression )  
   exBarStartPrev515 Retrieves the starting date of the bar before changing it ie if the user moves or resizes the bar at runtime, the exBarStartPrev gives during the BarResize event the previously starting date of the bar. (Date expression)  
   exBarEndPrev516 Retrieves the ending date of the bar before changing it ie if the user moves or resizes the bar at runtime, the exBarEndPrev gives during the BarResize event the previously starting date of the bar. (Date expression)  
   exBarDurationPrev517 Retrieves the duration or length of the bar before resizing it. During the BarResize event the exBarDurationPrev gives the length or duration of the bar before resizing it. You can distingue moving or resizing a specified bar by comparing the exBarDuration and exBarDurationPrev values. (Float expression)  
   exBarPercent100518 Specifies the percent from the original bar where the progress bar is displayed. Specifies the percent to display the progress on the bar, between 0 and 100. The exBarPercent100 option does the same thing as exBarPercent excepts that it works with integer values between 0 and 100, instead float expression from 0 to 1.  Use the Add("A%B") to add a combination of two bars, so the exBarPercent value specifies the percent from the bar A to be displayed as bar B. For instance, the Add("Task%Progress") adds a combination of Task and Progress bars, so the Task shape is displayed on the full bar, and the Progress shape is displayed only on the portion determined by the exBarPercent100 value. When you resize the original bar (A), the inside bar (B) is shown proportionally.  For instance, you can use the exBarPercent100 to display and edit values in the cells, when this property is associated with the cell using the AllowCellValueToItemBar property. The 0 value corresponds to the exBarStart, while 100 corresponds to the exBarEnd, so the formula Items.ItemBar(exBarStart) + (Items.ItemBar(exBarEnd)-Items.ItemBar(exBarStart))*Items.ItemBar(exBarPercent100)/100 gives exactly the date time where progress bar is in the chart. (long expression, between 0 and 100)  
   exBarIntersectWith519 Gets a collection of bars that intersect with the current bar. Use the exBarIntersectWithCount property to retrieve only the count of intersected bars. The result of exBarIntersectWith property is a collection of VARIANT values that indicates the keys of the bar in the current item that intersects with the current bar. The /NET or /WPF version provides a template function as public virtual List<object> get_BarIntersectWith(int Item, object Key) that returns a list of keys. The IntersectBars property specifies whether two bars intersect if returns 0, if 1 A is before B and -1 if A is after bar B. (safe array of variant expression)  
   exBarIntersectWithAsString520 Gets a collection of bars that intersect with the current bar as string. The list is separated by comma character. (string expression)  
   exBarIntersectWithCount521 Specifies the number of bars that intersects with the current bar. The IntersectBars property specifies whether two bars intersect if returns 0, if 1 A is before B and -1 if A is after bar B. (long expression)  
   exBarsGroup522 Retrieves a collection of bars being grouped with current bar. The result of exBarsGroup property is a collection of VARIANT values that indicates the handle of the item and the key of the bars being grouped with specified bar. The GroupBars method group two bars, while the Use the UngroupBars method to ungroup two bars or all bars. The /NET or /WPF version provides a template function as public virtual List<SelectedBar> get_BarsGroup(int Item, object Key) that returns a list of bars. The SelectedBar structure provides two members the Item and the Key, where the Item indicates the handle of the item that hosts the bar, while the Key indicates the key of the bar. 

The following VB/NET sample displays the bars being grouped with selected bar(s):

With Exg2antt1.Items
    Dim sSelected As List(Of exontrol.EXG2ANTTLib.Items.SelectedBar) = .get_SelectedBars()
    If Not sSelected Is Nothing Then
        Dim s As exontrol.EXG2ANTTLib.Items.SelectedBar
        For Each s In sSelected
            Debug.Print(s.Key & " from " & .get_CellCaption(s.Item, 0))
            Dim sGrouped As List(Of exontrol.EXG2ANTTLib.Items.SelectedBar) = .get_BarsGroup(s.Item, s.Key)
            If Not sGrouped Is Nothing Then
                Dim b As exontrol.EXG2ANTTLib.Items.SelectedBar
                For Each b In sGrouped
                    Debug.Print(vbTab & b.Key & " from " & .get_CellCaption(b.Item, 0))
                Next
            End If
        Next
    End If
End With

 

 
 


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