Print Page | Close Window

How to intercept the scroll event?

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


Topic: How to intercept the scroll event?
Posted By: energypf
Subject: How to intercept the scroll event?
Date Posted: 24 May 2010 at 4:12am
Hello, I'd place an ActiveX control created by me in the cell control Control Report. Regarding the positioning there are problems, as using the event FocusChanging, I can place the control cell, but when I go to make the scroll control rightly does not move because no event is not generated. How do I set the control to move to the cell? There is some event to trap the event scrolluing? Thank you. I hope for your response.



Replies:
Posted By: Aaron
Date Posted: 24 May 2010 at 11:32am
Hi,
 
I think you are better off, using just one event... The BeforeDrawRow event is THE event that covers most of what you are looking for. This event fires whenever ReportControl needs to be repainted. Clicking, scrolling, columnsizing, selecting row... etc etc etc  ...
 
 
 
Just set wndReportControl.SetCustomDraw xtpCustomBeforeDrawRow
 
Private Sub wndReportControl_BeforeDrawRow(ByVal Row As XtremeReportControl.IReportRow, ByVal Item As XtremeReportControl.IReportRecordItem, ByVal Metrics As XtremeReportControl.IReportRecordItemMetrics)
    
    'Your code goes here
    'For example:
    Dim l As Long
    Dim t As Long
    Dim r As Long
    Dim b As Long
    
    If Row.Record.Index = 1 And Item.Index = 1 Then
        'Get Row position and size
        Row.GetItemRect Item, l, t, r, b
        'stay on top
        YourOwnControl.ZOrder 0        
        'Position control on Record with index 1 and in second column (maybe you need to set a margin to get proper positioning)
        YourOwnControl.Move l * Screen.TwipsPerPixelX, t * Screen.TwipsPerPixelY, (r - l) * Screen.TwipsPerPixelX, (b - t) * Screen.TwipsPerPixelY 
    End If

End Sub
 
 
Now, try scrolling and column sizing, your control will stay on that position and with proper size 
 
 


-------------
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