473,386 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

thanks

Nov 20 '05 #1
1 2387
Hi,

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

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)

Dim Bytes, b As Byte()

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

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

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

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: | last post by:
Hi, I am setting the NumericUpDown .Value property and the ValueChanged event is NOT being fired. Does this ONLY get fired when I change it on the UI and not programatically? Thanks
1
by: Anand Ganesh | last post by:
Hi All, I am trying to draw a picture in a panel control. It is drawing up correctly. When the picture size is greater than the panel control, I am expecting horizontal and vertical scroll...
3
by: Benny | last post by:
Hello experts, Currently i am working on a windows form application using vs.net 2002 with C#. I have a panel in the form that it's AutoScroll property is set to true. The question is how can...
1
by: Dino M. Buljubasic | last post by:
I have two controls, a panel holding check boxes and a treeview beside the panel. I use buttons to scroll both of thes up and down at the same time but I'd like to make scroll bars on the...
7
by: Sharon | last post by:
I’m using the Panel control that contains a PictureBox control (for implementing the http://www.codeproject.com/cs/miscctrl/PictureBox.asp). The Panel is set to AutoScroll = true. I wish to...
1
by: Code Monkey | last post by:
using VS2005 and c# to create a windows forms application. One of my forms has a panel which I've added various controls to. Now, I've set the autoscroll property to true, which is great, but I...
6
by: Mike Johnson | last post by:
I have a ListView on a form, I'm displaying the items as a list. The Scroll is set to true. I want to know how can I set the scroll bar to Vertical?
1
markmcgookin
by: markmcgookin | last post by:
hi Folks, Just posting this as a solution to be honest (hope this is the right place) I created a form for PPC 2003 using VB.Net compact Framework One of my forms is longer than the screen,...
4
by: mateusz.zajakala | last post by:
Hi, I have panel (with autoscroll property) on which I'm dynamicaly adding of controls. When I want to scroll my panel using scrollbars it freezes all the controls added on that panel, makes...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.