![]() |
How to get the block's length in TrackControl? |
Post Reply ![]() |
Author | |
hellokenny ![]() Newbie ![]() Joined: 29 September 2011 Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() Posted: 30 September 2011 at 12:03am |
Hi, all,
I'm using the C# sample code for TrackControl, I want to get the block's length, my code is XtremeReportControl.ReportRecord R = wndTrackControl.Records[2]; XtremeReportControl.TrackControlItem T = (XtremeReportControl.TrackControlItem)R[3]; MessageBox.Show(T.BlockCount.ToString()); MessageBox.Show(T.Block[0].Length.ToString()); T.BlockCount is 5, it's OK. But the T.Block[0].Length shows error. Could anyone help me? Thanks! |
|
![]() |
|
Xander75 ![]() Senior Member ![]() ![]() Joined: 26 April 2007 Status: Offline Points: 353 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Below is some VB code that can be used to get the length of the block, hopefully you can port this to C#.
Hope this helps. |
|
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6) |
|
![]() |
|
hellokenny ![]() Newbie ![]() Joined: 29 September 2011 Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() |
Hi, Xander,
Thank you for your answer. But I want to get all block's length in the TrackControl, this way is not suitable for me Anyway, thank you very much. |
|
![]() |
|
Xander75 ![]() Senior Member ![]() ![]() Joined: 26 April 2007 Status: Offline Points: 353 |
![]() ![]() ![]() ![]() ![]() |
Hi,
It looks like there's no way to iterate through each Block within the TrackControl, the only thing I could find was "For Each Block In TrackControl.SelectedBlocks", but this is only useful if you select the blocks first. It looks like if you require this you'll need to put in a request for this functionality. |
|
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6) |
|
![]() |
|
hellokenny ![]() Newbie ![]() Joined: 29 September 2011 Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() |
Hi,
I tried this before, but this is not I want. Thanks. |
|
![]() |
|
Xander75 ![]() Senior Member ![]() ![]() Joined: 26 April 2007 Status: Offline Points: 353 |
![]() ![]() ![]() ![]() ![]() |
Hi,
I know this has been a while but I have found a way to interact with the Blocks after they're created. In VB I created a global variable as "Dim Block() As TrackBlock" Then as I added each block initially I added them to this variable incrementing the Object array each time, therefore once created you have access to the blocks lengths at anytime and you can iterate through the entire block collection. I have only found this out as I am trying to do something similar for the following post: http://forum.codejock.com/forum_posts.asp?TID=19708&title=trackcontrol-using-markup |
|
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6) |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |