| TrackControl using Markup
 
 Printed From: Codejock Forums
 Category:  Codejock Products
 Forum Name:  Report Control
 Forum Description:  Topics Related to Codejock Report Control
 URL: http://forum.codejock.com/forum_posts.asp?TID=19708
 Printed Date: 31 October 2025 at 7:31am
 Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
 
 
 Topic: TrackControl using Markup
 Posted By: Xander75
 Subject: TrackControl using Markup
 Date Posted: 03 May 2012 at 7:00am
 
 
        
          | Hi, 
 I have been playing around with the Codejock MarkupPad to create a ProgressBar that can be inserted into the Block.Caption within the TrackControl. I have managed to get this to work however I am now stuck because I can't seem to get the length of the Blocks at runtime, the TrackControl is zoomable so therefore the Blocks change length as the control is zoomed.
 
 So does anyone know of a way to get a Blocks length when the TrackControl is zoomed in and out?
 
 I am setting the ProgressBar width as Block.length but this is then auto zoomed to the best fit by default therefore the width is wrong and unfortunately the Markup won't allow Width='100%'
  
 Any ideas are appreciated!!!
 
 
 
  
 
 -------------
 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)
 |  
 
 Replies:
 Posted By: jpbro
 Date Posted: 03 May 2012 at 2:34pm
 
 
        
          | What if you try Width='Auto'? 
 
 -------------
 Product: Xtreme SuitePro (ActiveX) version 16.2.6
 Platform: Windows XP - SP3
 
 Language: Visual Basic 6.0 SP6
 
 
 |  
 Posted By: Xander75
 Date Posted: 04 May 2012 at 11:52am
 
 
        
          | I had tried the Width='Auto' but it didn't work in the approach I had taken, which was using the <Canvas> element. 
 I have instead opted for a <Grid> element as this allows you to set the <ColumnDefinition Width='100*'></ColumnDefinition> 100* being 100%
 
 This has allowed me to get the ProgressBar within the TrackBlock 
resizing correctly.
 
 See screenshot below:
 
  
 Note: There is a slight discrepancy in the ProgressBar value when zooming. But it's as near as damnit! I will see if I can tighten this up before I upload this version.
 
 
 
 -------------
 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)
 |  
 Posted By: jpbro
 Date Posted: 04 May 2012 at 10:48pm
 
 
        
          | Hi Xander75, 
 Glad you got it (mostly) working - maybe one of the progress bars in these threads will work for you 100%?:
 
 http://forum.codejock.com/forum_posts.asp?TID=14983&title=markup-user-interface-ideas
 http://forum.codejock.com/forum_posts.asp?TID=11171&title=com-vb-xaml-progressbar-demo
 
 
 -------------
 Product: Xtreme SuitePro (ActiveX) version 16.2.6
 Platform: Windows XP - SP3
 
 Language: Visual Basic 6.0 SP6
 
 
 |  
 Posted By: Xander75
 Date Posted: 05 May 2012 at 6:47am
 
 
        
          | After some tweaking of the aspect ratio code I have got it working quite well, if anyone can improve upon the zoom ratio code then please feel free to do so. 
 Here's the code:  uploads/2960/TrackControl_Using_Markup.rar - uploads/2960/TrackControl_Using_Markup.rar
 
 Here's the final screenshot:
 
  
 
 -------------
 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)
 |  
 
 |