Print Page | Close Window

The Click-Event by the ReportControl

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=2007
Printed Date: 17 November 2024 at 9:23pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: The Click-Event by the ReportControl
Posted By: finn
Subject: The Click-Event by the ReportControl
Date Posted: 22 March 2005 at 5:26am

Hello!

I'm working with Visual Basic 6 Enterprise Edition and have got one question. The ReportControl has got the Events "RowDblClik" and "RowRClick". But how can I know, that the user clicked with the left mouse button on the ReportControl. I want to know that, because I ant to react, when the user clicked with the left mouse butoon on the ReportControl.

Thanks for help!

Yours,

Finn!

PS.: Soryy for my bad English, but I'm from Germany and can't speak and write English very well.




Replies:
Posted By: Oleg
Date Posted: 22 March 2005 at 6:08am
use MouseDown event.

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


Posted By: finn
Date Posted: 22 March 2005 at 6:11am

Thank you!

Yours,

Finn!



Posted By: finn
Date Posted: 22 March 2005 at 8:44am

Hello!

I tried to use the MouseDown event, but it doesn't work like I want. Now I will tell you, what I want to do:

When the user clicks with the left mouse button on a row, which isn't a GroupRow, then I want to read out the value of the first column.

I hope you can help me!

Yours,

Finn



Posted By: ianp
Date Posted: 22 March 2005 at 9:43am

Take a look at the ReportControl Sample for a better idea of how to use the MouseDown event. Below is a modified snippet of the code from this event in frmMain.

Hope this does the trick


Private Sub wndReportControl_MouseDown(Button As Integer, Shift As Integer, X As Long, Y As Long)
Dim hitRow As ReportRow

If Button = vbLeftButton Then
    'Returns a reference to the row clicked
    'Determines which row the mouse was positioned over on mousedown.
    Set hitRow = wndReportControl.HitTest(X, Y).Row
    If Not hitRow Is Nothing Then
        If hitRow.GroupRow Then
             Debug.Print "MouseDown on GroupRow"
        Else
             Debug.Print "MouseDown on Row # " & hitRow.Index
             Debug.Print "Value of First Item added to the Record = " & hitRow.Record.Item(0).Value
        End If
    End If
End if
End Sub



Posted By: finn
Date Posted: 22 March 2005 at 9:53am

Thank you very much! It works very well!

Yours,

Finn!




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