By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,515 Members | 1,033 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,515 IT Pros & Developers. It's quick & easy.

how to handle scroll bar valuechanged event of a panel with autoscroll = true

P: n/a

Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a

You would have to create an inhertited control to do that. Here is a simple example.
<ToolboxBitmap(GetType(Panel))> _

Public Class PanelScroll

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


'This call is required by the Windows Form Designer.


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


End If

End If


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)

Dim Bytes, b As Byte()

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

RaiseEvent Scroll(Me, New EventArgs)

End If


End Sub

End Class



"Ivan" <ic*****> wrote in message news:%2******************@TK2MSFTNGP12.phx.gbl...

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.