Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - How to get the block's length in TrackControl?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to get the block's length in TrackControl?

 Post Reply Post Reply
Author
Message
hellokenny View Drop Down
Newbie
Newbie


Joined: 29 September 2011
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote hellokenny Quote  Post ReplyReply Direct Link To This Post Topic: How to get the block's length in TrackControl?
    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!
Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post Posted: 05 October 2011 at 9:27am
Hi,

Below is some VB code that can be used to get the length of the block, hopefully you can port this to C#.

Private Sub TrackControl_MouseUp(Button As Integer, Shift As Integer, x As Long, y As Long)
   
    Select Case TrackControl.HitTest(x, y).ht
       Case xtpHitTestBlock
            Debug.Print TrackControl.HitTest(x, y).Block.Length
    End Select

End Sub


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)
Back to Top
hellokenny View Drop Down
Newbie
Newbie


Joined: 29 September 2011
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote hellokenny Quote  Post ReplyReply Direct Link To This Post Posted: 11 October 2011 at 11:51pm
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.

Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post Posted: 13 October 2011 at 3:45am
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)
Back to Top
hellokenny View Drop Down
Newbie
Newbie


Joined: 29 September 2011
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote hellokenny Quote  Post ReplyReply Direct Link To This Post Posted: 18 October 2011 at 2:28am
Hi,

I tried this before, but this is not I want. Thanks.
Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post Posted: 03 May 2012 at 9:49am
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)
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.