Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

scrollbar events

1 view
Skip to first unread message

Mark Preuss

unread,
Jan 12, 2004, 2:40:50 PM1/12/04
to
Hi,
I am looking for a way to trap a click on the scrollbar which is part of a
list view control. I update the list view
regularly and I want to inhibit the updates while the user
is using the scroll. None of the mouse events, the click
or enter events seem to fire when the scrollbar is being
used.

Any help is appreciated!
Mark


Ken Tucker [MVP]

unread,
Jan 12, 2004, 8:34:30 PM1/12/04
to
Hi,

You will have to create an inherited listview and use that instead.
Here is a simple example.

<ToolboxBitmap(GetType(ListView))> _

Public Class ListViewScroll

Inherits System.Windows.Forms.Panel

Public Event Scroll(ByVal sender As Object, ByVal e As EventArgs)

Private Const WM_VSCROLL = &H115

Private Const WM_HSCROLL = &H114

#Region " Windows Form Designer generated code "

Public Sub New()

MyBase.New()

'This call is required by the Windows Form Designer.

InitializeComponent()

Me.HorizontalScrollbar = True

'Add any initialization after the InitializeComponent() call

End Sub

'UserControl1 overrides dispose to clean up the component list.

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)

If disposing Then

If Not (components Is Nothing) Then

components.Dispose()

End If

End If

MyBase.Dispose(disposing)

End Sub

'Required by the Windows Form Designer

Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

components = New System.ComponentModel.Container

End Sub

#End Region

Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)

If m.Msg = WM_VSCROLL Or m.Msg = WM_HSCROLL Then

RaiseEvent Scroll(Me, New EventArgs)

End If

MyBase.WndProc(m)

End Sub

End Class

Ken

------------------------

"Mark Preuss" <nos...@nowhere.com> wrote in message
news:uQfK9PU...@tk2msftngp13.phx.gbl...

0 new messages