Print Page | Close Window

Scrollbars

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=12628
Printed Date: 21 November 2024 at 7:57pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Scrollbars
Posted By: oddi
Subject: Scrollbars
Date Posted: 07 November 2008 at 3:55am
Is there a way to know when the scrollbar hits bottom.
What i am trying to do is this.
I attached a codejock scrollbar to the reportcontrol and lets say i load 100 records to the reportcontrol i want to add the next buffer (100) when the scrollbar hits bottom, the thing is that the value scrollbar max value changes all the time when reportcontrol is resized.
Hope this makes any sense.

Regards


-------------
Oddi,
Product: Xtreme SuitePro (ActiveX) version 11.2.1
     Platform: Windows XP (32bit) - SP 2
     Language: Visual Basic 6.0



Replies:
Posted By: Oleg
Date Posted: 07 November 2008 at 5:17am
Hi,
 
Do you use SetScrollBars method to attach it ?


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: oddi
Date Posted: 07 November 2008 at 5:18am
Yes.

-------------
Oddi,
Product: Xtreme SuitePro (ActiveX) version 11.2.1
     Platform: Windows XP (32bit) - SP 2
     Language: Visual Basic 6.0


Posted By: Aaron
Date Posted: 07 November 2008 at 7:58am
Originally posted by oddi oddi wrote:

Is there a way to know when the scrollbar hits bottom.
What i am trying to do is this.
I attached a codejock scrollbar to the reportcontrol and lets say i load 100 records to the reportcontrol i want to add the next buffer (100) when the scrollbar hits bottom, the thing is that the value scrollbar max value changes all the time when reportcontrol is resized.
Hope this makes any sense.

Regards
 
Hi,
 
Value of VerticalScroll will always be number of rows MINUS number of visible rows. To determine how many rows are in the visible portion of RC:
 
Dim firstRow As Long
Dim lastRow As Long
Dim numberOfVisibleRows as long

wndReportControl.Navigator.MoveFirstVisibleRow
firstRow = wndReportControl.FocusedRow.Index
wndReportControl.Navigator.MoveLastVisibleRow
lastRow = wndReportControl.FocusedRow.Index
 
So:
 
numberOfVisibleRows = lastRow - firstrow
 
So:
 
If wndReportControlData.Rows.Count = (VScroll.Value + 1) + numberOfVisibleRows  Then "Do Something"
 
Note: VScroll.Value is zero based, that's why +1
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: oddi
Date Posted: 07 November 2008 at 8:48am
Thanx alot Aaron.
Helps me a lot


-------------
Oddi,
Product: Xtreme SuitePro (ActiveX) version 11.2.1
     Platform: Windows XP (32bit) - SP 2
     Language: Visual Basic 6.0


Posted By: oddi
Date Posted: 19 November 2008 at 7:30am
One more try and bare with me on this, i am quite new to these controls.
The code you showed me works perfectly with the scrollbar, i can load next buffer to grid when scrollbar hits bottom .

But how about when i scroll the grid with the mouse or page down, the report control does not fire the scrollbar change event.

Aaron i am sure you know a trick or two to guide me on the right track regarding this issue.

Again thanks for all the support.

Regards,




-------------
Oddi,
Product: Xtreme SuitePro (ActiveX) version 11.2.1
     Platform: Windows XP (32bit) - SP 2
     Language: Visual Basic 6.0


Posted By: Aaron
Date Posted: 20 November 2008 at 10:49am
Hi,
 
The hat is empty (no tricks in it...)
 
Maybe you need to approach this another way. FocusChange event of RC is fired when using arrow / page-up / page-down keys.
 
You could use this FocusChange event to determine if last row is selected:
 
If wndReportControl.Rows.Count = NewRow.Index + 1 Then "Do Something"
 
If you would use wndReportControl.Navigator.MoveLastVisibleRow in VScroll_Change event the FocusChange event will be fired everytime the user clicks on scrollbar buttons. But this doesn't work correct, CJ developers. Only when scrolling to the top works correct. Scrolling down it doesn't select last visible row
 
 
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net