![]() | Type | Description | ||
| ResHandle as Long | A Handle expression being returned by the ResHandle property. | |||
| Type as PutResEnum | A PutResEnnum expression that indicates whether the control loads or saves the bar's resources to or from another control. |
The following sample shows the bar's allocation of resources: ( for instance the Task 1 uses the R1, Task 2 uses the R1 and R2, while Task 3 uses R2 on 60% and R3 on 39%, and so on )

(source, picture 1)
while the next picture shows the resource usage being taken from the first picture ( for instance, the R1 is being used by Task 1 and Task 2, R2 is used by Task 2, Task 3 on 60% and Task 4, and so on ) :

(target, picture 2)
The Source ( picture 1 ) is the original control that displays your activities / bars. Use the Source.PutRes( Target.ResHandle, exPutResSave ) to update the bar's resources in a Source control, from a Target control. IN a Source control, you can use the following properties to specify the usage of resources.
You can use the exBarCaption to display the bar's resources using the <%=formula%> format, like in the following VB sample:
With G2antt1.Chart.Bars("Task") .Def(EXG2ANTTLibCtl.ItemBarPropertyEnum.exBarCaption) = "<%=%" & EXG2ANTTLibCtl.ItemBarPropertyEnum.exBarResources & "%>" .Def(EXG2ANTTLibCtl.ItemBarPropertyEnum.exBarHAlignCaption) = 18 End WithIn other words, the sample allows you to display the bar's exBarResources property as shown bellow:
The set exBarResources property could be used in the following format based on the first character as listed:
- If the first character is +(plus), the rest of the expression indicates the resources to be assigned to the current bar. For instance, if the current bar has the exBarResources property as "R1,R2" , and we call set exBarResources as "+R3", it means that the R3 is added to the bar's resources, and so the new exBarResources property is "R1,R2,R3".
- If the first character is -(minus), the rest of the expression indicates the resources to be removed from the current bar. For instance, if the current bar has the exBarResources property as "R1,R2" , and we call set exBarResources as "-R2", it means that the R2 is removed from the bar's resources, and so the new exBarResources property is "R1".
- If no +,- character, the new expression replaces the exBarResources property. For instance, if the current bar has the exBarResources property as "R1,R2" , and we call set exBarResources as "R3,R4", it means that the new exBarResources property is "R3,R4".
With G2antt1.Chart.Bars("Task") .Def(exBarResourceFormat) = "`<b>` + name + `</b><font ;5><fgcolor=404040>` + (percent = 1 ? `` : (round(100*percent) format ``) + `%` ) + `</fgcolor></font>`" .Def(EXG2ANTTLibCtl.ItemBarPropertyEnum.exBarCaption) = "<%=%" & EXG2ANTTLibCtl.ItemBarPropertyEnum.exBarResourcesFormat & "%>" .Def(EXG2ANTTLibCtl.ItemBarPropertyEnum.exBarHAlignCaption) = 18 End WithIn other words, the sample allows you to display the bar's exBarResources property as shown bellow:
The Target ( picture 2 ) is the control that displays the Resources column, where all resources found are being added line by line, and its usage on items. Use the Target.PutRes(Source.ResHandle, exPutResLoad) to update the Target control from a Source control. IN a Target control, you can use the following properties to specify the usage of resources.
Private Sub G2antt1_BarResizing(ByVal Item As EXG2ANTTLibCtl.HITEM, ByVal Key As Variant) With G2antt1.Items .ItemBar(Item, Key, EXG2ANTTLibCtl.ItemBarPropertyEnum.exBarEffort) = .ItemBar(Item, Key, EXG2ANTTLibCtl.ItemBarPropertyEnum.exBarPercent) End With End Sub