Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - how select rows by drag mouse?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

how select rows by drag mouse?

 Post Reply Post Reply
Author
Message
mozaheb View Drop Down
Senior Member
Senior Member


Joined: 03 April 2008
Status: Offline
Points: 104
Post Options Post Options   Thanks (0) Thanks(0)   Quote mozaheb Quote  Post ReplyReply Direct Link To This Post Topic: how select rows by drag mouse?
    Posted: 07 October 2008 at 6:15am
hi all

help me about how select rows by drag mouse?

thank you

Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 24 October 2008 at 3:57am
Hi,
 
You can't. Fastest way to select multiple rows is setting property MultipleSelectiom = true and with CTRL / SHIFT key + mouse,  arrow keys, pagedown etc. etc. (just as ordinary listview items)
 
 
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....
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 24 October 2008 at 5:10pm
You can't do this automatically with a property or method of the ReportControl, but you can code it yourself. Something like this:


Private Sub wndReportControl_MouseDown(Button As Integer, Shift As Integer, x As Long, y As Long)
   Dim lo_Row                                     As ReportRow

   Set lo_Row = wndReportControl.HitTest(x, y).Row
   If Not lo_Row Is Nothing Then
      If Not lo_Row.GroupRow Then
         m_FirstSelection = lo_Row.Index
      End If
   End If
End Sub

Private Sub wndReportControl_MouseMove(Button As Integer, Shift As Integer, x As Long, y As Long)
   Dim lo_Hit                                     As ReportHitTestInfo
   Dim i                                          As Long
   Dim l_Step                                     As Long

   If Button = vbLeftButton Then
      If m_FirstSelection >= 0 Then
         Me.wndReportControl.SelectedRows.DeleteAll
         Set lo_Hit = Me.wndReportControl.HitTest(x, y)
         If Not lo_Hit Is Nothing Then
            If Not lo_Hit.Row Is Nothing Then
               If lo_Hit.Row.Index < m_FirstSelection Then
                  l_Step = -1
               Else
                  l_Step = 1
               End If

               For i = m_FirstSelection To lo_Hit.Row.Index Step l_Step
                  If Not Me.wndReportControl.Rows(i).GroupRow Then
                     Me.wndReportControl.Rows(i).Selected = True
                  End If
               Next i
            End If
         End If
      End If
   End If
End Sub

Private Sub wndReportControl_MouseUp(Button As Integer, Shift As Integer, x As Long, y As Long)
   m_FirstSelection = -1
End Sub

Private Sub Form_Load()
    m_FirstSelection = -1
End Sub

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

Language: Visual Basic 6.0 SP6

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.