Print Page | Close Window

SOLVED: Scrollbar 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=10894
Printed Date: 02 May 2025 at 9:20am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SOLVED: Scrollbar Event
Posted By: ElvisM
Subject: SOLVED: Scrollbar Event
Date Posted: 03 June 2008 at 7:42pm

Hi friends.

Eexcuse me by my english, is so basic.

There's a way to capture the event when the user is using the scrollbar?

 
regards,
Elvis


-------------
Product: Xtreme SuitePro (ActiveX) version 17.2
Platform: Windows 10 64bits
Language: Visual Basic 2015



Replies:
Posted By: Aaron
Date Posted: 04 June 2008 at 1:53am
Hi,
 
Sorry, there's no event.
 
You could use your own scrollbars:
 
wndReportControl.SetScrollBars ScrollBarHorizontal.hwnd, ScrollBarVertical.hwnd
 
and have the scroll_change events.
 
 
If I may ask, why do you need this?
 
 


-------------
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: ElvisM
Date Posted: 04 June 2008 at 12:20pm
Because, I'm simulating a merge cell's using labels in te top of the reporcontrol. I need move the labels when the user moves the horizontal scrollbar, but if I can't capture this event... :-(
 
Sorry by my english..


Posted By: Aaron
Date Posted: 04 June 2008 at 12:52pm
Hi,
 
Can you upload a sample project?


-------------
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: jpbro
Date Posted: 04 June 2008 at 1:54pm
Here's a sample that subclasses the child window of the ReporControl to capture WM_HSCROLL (horizontal scroll) messages. It doesn't do much (just notifies you that the horizontal scrollbar position has changed by printing "HORIZONTAL SCROLL" to the debug window), so you will have to do some additional work.


uploads/20080604_135002_SubclassReportC.zip - uploads/20080604_135002_SubclassReportC.zip

IMPORTANT NOTE ABOUT SUBCLASSING: If you set a breakpoint in your code (or press Ctrl+Break) while a control is subclassed, you will likely crash your entire VB IDE and lose all your work, so make sure to SAVE OFTEN! This is just a demonstration of the technique, but I highly recommend you use a safe subclassing control (or roll your own by compiling the code into a DLL). There's a good one for free here:

http://www.vbaccelerator.com/home/VB/Code/Libraries/Subclassing/SSubTimer/article.asp - http://www.vbaccelerator.com/home/VB/Code/Libraries/Subclassing/SSubTimer/article.asp

And you can see in this example how they get more detailed information about the scrollbar position/scroll direction:

http://www.vbaccelerator.com/home/Vb/Code/Controls/S_Grid/VB6_Full_Source_Code_zip_cScrollBars_cls.asp - http://www.vbaccelerator.com/home/Vb/Code/Controls/S_Grid/VB6_Full_Source_Code_zip_cScrollBars_cls.asp

Good luck!


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: Aaron
Date Posted: 04 June 2008 at 2:06pm
Originally posted by jpbro jpbro wrote:

Here's a sample that subclasses the child window of the ReporControl to capture WM_HSCROLL                Good luck!
 
Hi, and Good luck you will need
 
Think you are better of with my option (at least try it first)
 
Elvis, give me at least a screenshot of what you are trying to do


-------------
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: jpbro
Date Posted: 04 June 2008 at 2:36pm
Oh subclassing is not so bad once you get used to it ;)

-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: Aaron
Date Posted: 04 June 2008 at 2:56pm
Originally posted by jpbro jpbro wrote:

Oh subclassing is not so bad once you get used to it ;)
 
Hi,
 
Yeah right, subclassing is also inheriting the monday morning implementations  I let CJ do the subclassing and if there's something not working as expected then I will use the issue tracker
 
 


-------------
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: ElvisM
Date Posted: 04 June 2008 at 5:17pm

Hi, this is the screenshot.



Posted By: Aaron
Date Posted: 05 June 2008 at 1:27am
Hi,
 
Of course we don't need Subclassing  
 
https://forum.codejock.com/uploads/20080605_022416_TestColumns.zip - uploads/20080605_022416_TestColumns.zip
https://forum.codejock.com/uploads/20080605_012739_TestColumns.zip -  
 
Maybe it needs a little tuning for your needs  


-------------
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: ElvisM
Date Posted: 06 June 2008 at 11:41am
aaron, thank you a lot!!!
This work!!!!
 
Regards.


Posted By: Aaron
Date Posted: 10 June 2008 at 4:54am
Hi,
 
You could add CJ labels and set MarkUp.Enabled = true
and have the labels like this:
 
 
 
 
 
 
Private Function SetMarkupLabels(lbl As XtremeSuiteControls.Label)
lbl.Caption = _
"<Border xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'" & _
    "VerticalAlignment='Center' HorizontalAlignment='Center' BorderThickness='1' BorderBrush='#767676' MinHeight='" & lbl.Height / Screen.TwipsPerPixelY & "' MinWidth='" & lbl.Width / Screen.TwipsPerPixelX & "'>" & _
        "<Border.Background>" & _
        "<LinearGradientBrush StartPoint='0,0' EndPoint='0,1'>" & _
            "<GradientStop Color='white' Offset='0.0'/>" & _
            "<GradientStop Color='lightblue' Offset='1.0'/>" & _
        "</LinearGradientBrush>" & _
        "</Border.Background>" & _
        "<StackPanel>" & _
        "<TextBlock HorizontalAlignment='center' Foreground='Black' FontSize='16' FontWeight='Bold' FontFamily='Tahoma' Text='" & lbl.ToolTipText & "'/>" & _
        "</StackPanel>" & _
    "</Border>"
   
End Function
 
 
There are a lot of (visual) options when doing it like this. I just put it together to give you an idea. The text in the label is the tooltiptext of the label
 
 


-------------
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: ElvisM
Date Posted: 10 June 2008 at 10:50am

Good job Aaron.

Thank you.

But, is very very necessary that the Codejock includes the mergecell option into the reportcontrol. This is a critical feature. And is very usefull for the programmers.

 




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