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

Scrollbars

P: n/a
I have a treeview and a checked list view controls one beside another. I
want to make them work so that when I scroll down or up one of them the
other does the same.

Any help will be appreciated

--
Dino Buljubasic
Software Developer
http://rivusglobal.com

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


P: n/a
Your going to have to use the Windows API to make the other control scroll
down. Trap the onVScroll event of the control which you want to be the
master and have it send a message to the slave control.

You need to use the User32.DLL and send a Message using the constant for
vertical scroll to the handle of the other control.

HTH

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:GK**********************@news2.telusplanet.ne t...
I have a treeview and a checked list view controls one beside another. I
want to make them work so that when I scroll down or up one of them the
other does the same.

Any help will be appreciated

--
Dino Buljubasic
Software Developer
http://rivusglobal.com

Nov 20 '05 #2

P: n/a
Tree View or Checked List View do not have onVScroll event.
"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:%2****************@tk2msftngp13.phx.gbl...
Your going to have to use the Windows API to make the other control scroll
down. Trap the onVScroll event of the control which you want to be the
master and have it send a message to the slave control.

You need to use the User32.DLL and send a Message using the constant for
vertical scroll to the handle of the other control.

HTH

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:GK**********************@news2.telusplanet.ne t...
I have a treeview and a checked list view controls one beside another. I want to make them work so that when I scroll down or up one of them the
other does the same.

Any help will be appreciated

--
Dino Buljubasic
Software Developer
http://rivusglobal.com


Nov 20 '05 #3

P: n/a
They are inherited from Control - Try this - I havent tried it for the tree
control but this is a working example for the checked listbox ( This works )

Regards OHM
----------------------------------------------------------------------------
----------------------------
Public Class Form1

Inherits System.Windows.Forms.Form

Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA"
(ByVal hWnd As IntPtr, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal
lParam As Int32) As Int32

Const WM_VSCROLL As Int32 = &H115

Const SB_LINEDOWN As Int32 = 1

Const SB_LINEUP As Int32 = 0

#Region " Windows Form Designer generated code "

Public Sub New()

MyBase.New()

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form 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.

Friend WithEvents PerformVscroll As System.Windows.Forms.Button

Friend WithEvents rtb2 As System.Windows.Forms.RichTextBox

Friend WithEvents ScrollUP As System.Windows.Forms.Button

Friend WithEvents lb1 As System.Windows.Forms.ListBox

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

Me.PerformVscroll = New System.Windows.Forms.Button

Me.rtb2 = New System.Windows.Forms.RichTextBox

Me.ScrollUP = New System.Windows.Forms.Button

Me.lb1 = New System.Windows.Forms.ListBox

Me.SuspendLayout()

'

'PerformVscroll

'

Me.PerformVscroll.Location = New System.Drawing.Point(216, 192)

Me.PerformVscroll.Name = "PerformVscroll"

Me.PerformVscroll.Size = New System.Drawing.Size(104, 23)

Me.PerformVscroll.TabIndex = 2

Me.PerformVscroll.Text = "Scroll Up"

'

'rtb2

'

Me.rtb2.Location = New System.Drawing.Point(112, 120)

Me.rtb2.Name = "rtb2"

Me.rtb2.TabIndex = 3

Me.rtb2.Text = "RichTextBox1"

'

'ScrollUP

'

Me.ScrollUP.Location = New System.Drawing.Point(216, 120)

Me.ScrollUP.Name = "ScrollUP"

Me.ScrollUP.Size = New System.Drawing.Size(104, 23)

Me.ScrollUP.TabIndex = 4

Me.ScrollUP.Text = "Scroll UP"

'

'lb1

'

Me.lb1.Items.AddRange(New Object() {"1", "2", "3", "4", "5", "6", "7", "8",
"10", "11", "12", "13", "14", "12", "13", "14", "15"})

Me.lb1.Location = New System.Drawing.Point(408, 96)

Me.lb1.Name = "lb1"

Me.lb1.Size = New System.Drawing.Size(120, 95)

Me.lb1.TabIndex = 5

'

'Form1

'

Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

Me.ClientSize = New System.Drawing.Size(680, 293)

Me.Controls.Add(Me.lb1)

Me.Controls.Add(Me.ScrollUP)

Me.Controls.Add(Me.rtb2)

Me.Controls.Add(Me.PerformVscroll)

Me.Name = "Form1"

Me.Text = "Form1"

Me.ResumeLayout(False)

End Sub

#End Region

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)

Dim ea As New EventArgs

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

rtb2.ScrollBars = RichTextBoxScrollBars.None

rtb2.Text +=
"RichTextBox1jkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjj khkjhgjghjgjkhkhgjkhgkjjkh
kjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkj hgjghjgjkhkhgjkhgkjjkhkjhg
jghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjg hjgjkhkhgjkhgkjjkhkjhgjghj
gjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgj khkhgjkhgkjjkhkjhgjghjgjkh
khgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkh gjkhgkjjkhkjhgjghjgjkhkhgj
khgkjjkhkjhgjghJJJJJkjjkhkjhgjghjgjkhkhgjkhgkjjkhk jhgjghjgjkhkhgjkhgkjjkhkjh
gjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgj ghjgjkhkhgjkhgkjjkhkjhgjgh
jgjkhkhgjkhgkjjkhkjhgjghjgjkhkhCCCCCC*******CCCCCC "

End Sub

Private Sub PerformScroll_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles PerformVscroll.Click

'SendMessage(rtb2.Handle, WM_VSCROLL, SB_LINEDOWN, 0)

SendMessage(lb1.Handle, WM_VSCROLL, SB_LINEDOWN, 0)

End Sub

Private Sub handleScroll(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles rtb2.VScroll

Console.WriteLine("Scrolling")

End Sub

Private Sub ScrollUP_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ScrollUP.Click

'SendMessage(rtb2.Handle, WM_VSCROLL, SB_LINEUP, 0)

SendMessage(lb1.Handle, WM_VSCROLL, SB_LINEUP, 0)

End Sub

End Class

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:b6**********************@news2.telusplanet.ne t...
Tree View or Checked List View do not have onVScroll event.
"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:%2****************@tk2msftngp13.phx.gbl...
Your going to have to use the Windows API to make the other control scroll
down. Trap the onVScroll event of the control which you want to be the
master and have it send a message to the slave control.

You need to use the User32.DLL and send a Message using the constant for
vertical scroll to the handle of the other control.

HTH

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:GK**********************@news2.telusplanet.ne t...
I have a treeview and a checked list view controls one beside another.

I want to make them work so that when I scroll down or up one of them the other does the same.

Any help will be appreciated

--
Dino Buljubasic
Software Developer
http://rivusglobal.com



Nov 20 '05 #4

P: n/a
Thanks, but that one scroll only the label on the right. It does not scroll
the rich text box on the left.

Is it possible to make them scroll both at the same time?
"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:u$**************@TK2MSFTNGP09.phx.gbl...
They are inherited from Control - Try this - I havent tried it for the tree control but this is a working example for the checked listbox ( This works )
Regards OHM
-------------------------------------------------------------------------- -- ----------------------------
Public Class Form1

Inherits System.Windows.Forms.Form

Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA"
(ByVal hWnd As IntPtr, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal
lParam As Int32) As Int32

Const WM_VSCROLL As Int32 = &H115

Const SB_LINEDOWN As Int32 = 1

Const SB_LINEUP As Int32 = 0

#Region " Windows Form Designer generated code "

Public Sub New()

MyBase.New()

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form 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.

Friend WithEvents PerformVscroll As System.Windows.Forms.Button

Friend WithEvents rtb2 As System.Windows.Forms.RichTextBox

Friend WithEvents ScrollUP As System.Windows.Forms.Button

Friend WithEvents lb1 As System.Windows.Forms.ListBox

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.PerformVscroll = New System.Windows.Forms.Button

Me.rtb2 = New System.Windows.Forms.RichTextBox

Me.ScrollUP = New System.Windows.Forms.Button

Me.lb1 = New System.Windows.Forms.ListBox

Me.SuspendLayout()

'

'PerformVscroll

'

Me.PerformVscroll.Location = New System.Drawing.Point(216, 192)

Me.PerformVscroll.Name = "PerformVscroll"

Me.PerformVscroll.Size = New System.Drawing.Size(104, 23)

Me.PerformVscroll.TabIndex = 2

Me.PerformVscroll.Text = "Scroll Up"

'

'rtb2

'

Me.rtb2.Location = New System.Drawing.Point(112, 120)

Me.rtb2.Name = "rtb2"

Me.rtb2.TabIndex = 3

Me.rtb2.Text = "RichTextBox1"

'

'ScrollUP

'

Me.ScrollUP.Location = New System.Drawing.Point(216, 120)

Me.ScrollUP.Name = "ScrollUP"

Me.ScrollUP.Size = New System.Drawing.Size(104, 23)

Me.ScrollUP.TabIndex = 4

Me.ScrollUP.Text = "Scroll UP"

'

'lb1

'

Me.lb1.Items.AddRange(New Object() {"1", "2", "3", "4", "5", "6", "7", "8", "10", "11", "12", "13", "14", "12", "13", "14", "15"})

Me.lb1.Location = New System.Drawing.Point(408, 96)

Me.lb1.Name = "lb1"

Me.lb1.Size = New System.Drawing.Size(120, 95)

Me.lb1.TabIndex = 5

'

'Form1

'

Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

Me.ClientSize = New System.Drawing.Size(680, 293)

Me.Controls.Add(Me.lb1)

Me.Controls.Add(Me.ScrollUP)

Me.Controls.Add(Me.rtb2)

Me.Controls.Add(Me.PerformVscroll)

Me.Name = "Form1"

Me.Text = "Form1"

Me.ResumeLayout(False)

End Sub

#End Region

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)

Dim ea As New EventArgs

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

rtb2.ScrollBars = RichTextBoxScrollBars.None

rtb2.Text +=
"RichTextBox1jkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjj khkjhgjghjgjkhkhgjkhgkjjkh kjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkj hgjghjgjkhkhgjkhgkjjkhkjhg jghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjg hjgjkhkhgjkhgkjjkhkjhgjghj gjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgj khkhgjkhgkjjkhkjhgjghjgjkh khgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkh gjkhgkjjkhkjhgjghjgjkhkhgj khgkjjkhkjhgjghJJJJJkjjkhkjhgjghjgjkhkhgjkhgkjjkhk jhgjghjgjkhkhgjkhgkjjkhkjh gjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgj ghjgjkhkhgjkhgkjjkhkjhgjgh jgjkhkhgjkhgkjjkhkjhgjghjgjkhkhCCCCCC*******CCCCCC "

End Sub

Private Sub PerformScroll_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles PerformVscroll.Click

'SendMessage(rtb2.Handle, WM_VSCROLL, SB_LINEDOWN, 0)

SendMessage(lb1.Handle, WM_VSCROLL, SB_LINEDOWN, 0)

End Sub

Private Sub handleScroll(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles rtb2.VScroll

Console.WriteLine("Scrolling")

End Sub

Private Sub ScrollUP_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ScrollUP.Click

'SendMessage(rtb2.Handle, WM_VSCROLL, SB_LINEUP, 0)

SendMessage(lb1.Handle, WM_VSCROLL, SB_LINEUP, 0)

End Sub

End Class

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:b6**********************@news2.telusplanet.ne t...
Tree View or Checked List View do not have onVScroll event.
"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:%2****************@tk2msftngp13.phx.gbl...
Your going to have to use the Windows API to make the other control scroll down. Trap the onVScroll event of the control which you want to be the
master and have it send a message to the slave control.

You need to use the User32.DLL and send a Message using the constant for vertical scroll to the handle of the other control.

HTH

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message news:GK**********************@news2.telusplanet.ne t...
> I have a treeview and a checked list view controls one beside
another.
I
> want to make them work so that when I scroll down or up one of them

the > other does the same.
>
> Any help will be appreciated
>
> --
> Dino Buljubasic
> Software Developer
> http://rivusglobal.com
>
>
>



Nov 20 '05 #5

P: n/a
Ok, I got it. I just have to send the message to the other controls as
well. I'll try this with the tree view and checked list view to check.

I appreciate your help.
--
Dino Buljubasic
Software Developer
http://rivusglobal.com

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:TD**********************@news2.telusplanet.ne t...
Thanks, but that one scroll only the label on the right. It does not scroll the rich text box on the left.

Is it possible to make them scroll both at the same time?
"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:u$**************@TK2MSFTNGP09.phx.gbl...
They are inherited from Control - Try this - I havent tried it for the

tree
control but this is a working example for the checked listbox ( This

works )

Regards OHM


--------------------------------------------------------------------------
--
----------------------------
Public Class Form1

Inherits System.Windows.Forms.Form

Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA"
(ByVal hWnd As IntPtr, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal
lParam As Int32) As Int32

Const WM_VSCROLL As Int32 = &H115

Const SB_LINEDOWN As Int32 = 1

Const SB_LINEUP As Int32 = 0

#Region " Windows Form Designer generated code "

Public Sub New()

MyBase.New()

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form 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.

Friend WithEvents PerformVscroll As System.Windows.Forms.Button

Friend WithEvents rtb2 As System.Windows.Forms.RichTextBox

Friend WithEvents ScrollUP As System.Windows.Forms.Button

Friend WithEvents lb1 As System.Windows.Forms.ListBox

<System.Diagnostics.DebuggerStepThrough()> Private Sub

InitializeComponent()

Me.PerformVscroll = New System.Windows.Forms.Button

Me.rtb2 = New System.Windows.Forms.RichTextBox

Me.ScrollUP = New System.Windows.Forms.Button

Me.lb1 = New System.Windows.Forms.ListBox

Me.SuspendLayout()

'

'PerformVscroll

'

Me.PerformVscroll.Location = New System.Drawing.Point(216, 192)

Me.PerformVscroll.Name = "PerformVscroll"

Me.PerformVscroll.Size = New System.Drawing.Size(104, 23)

Me.PerformVscroll.TabIndex = 2

Me.PerformVscroll.Text = "Scroll Up"

'

'rtb2

'

Me.rtb2.Location = New System.Drawing.Point(112, 120)

Me.rtb2.Name = "rtb2"

Me.rtb2.TabIndex = 3

Me.rtb2.Text = "RichTextBox1"

'

'ScrollUP

'

Me.ScrollUP.Location = New System.Drawing.Point(216, 120)

Me.ScrollUP.Name = "ScrollUP"

Me.ScrollUP.Size = New System.Drawing.Size(104, 23)

Me.ScrollUP.TabIndex = 4

Me.ScrollUP.Text = "Scroll UP"

'

'lb1

'

Me.lb1.Items.AddRange(New Object() {"1", "2", "3", "4", "5", "6", "7",

"8",
"10", "11", "12", "13", "14", "12", "13", "14", "15"})

Me.lb1.Location = New System.Drawing.Point(408, 96)

Me.lb1.Name = "lb1"

Me.lb1.Size = New System.Drawing.Size(120, 95)

Me.lb1.TabIndex = 5

'

'Form1

'

Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

Me.ClientSize = New System.Drawing.Size(680, 293)

Me.Controls.Add(Me.lb1)

Me.Controls.Add(Me.ScrollUP)

Me.Controls.Add(Me.rtb2)

Me.Controls.Add(Me.PerformVscroll)

Me.Name = "Form1"

Me.Text = "Form1"

Me.ResumeLayout(False)

End Sub

#End Region

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)

Dim ea As New EventArgs

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

rtb2.ScrollBars = RichTextBoxScrollBars.None

rtb2.Text +=

"RichTextBox1jkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjj khkjhgjghjgjkhkhgjkhgkjjkh

kjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkj hgjghjgjkhkhgjkhgkjjkhkjhg

jghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjg hjgjkhkhgjkhgkjjkhkjhgjghj

gjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgj khkhgjkhgkjjkhkjhgjghjgjkh

khgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkh gjkhgkjjkhkjhgjghjgjkhkhgj

khgkjjkhkjhgjghJJJJJkjjkhkjhgjghjgjkhkhgjkhgkjjkhk jhgjghjgjkhkhgjkhgkjjkhkjh

gjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgj ghjgjkhkhgjkhgkjjkhkjhgjgh
jgjkhkhgjkhgkjjkhkjhgjghjgjkhkhCCCCCC*******CCCCCC "

End Sub

Private Sub PerformScroll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PerformVscroll.Click

'SendMessage(rtb2.Handle, WM_VSCROLL, SB_LINEDOWN, 0)

SendMessage(lb1.Handle, WM_VSCROLL, SB_LINEDOWN, 0)

End Sub

Private Sub handleScroll(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles rtb2.VScroll

Console.WriteLine("Scrolling")

End Sub

Private Sub ScrollUP_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ScrollUP.Click

'SendMessage(rtb2.Handle, WM_VSCROLL, SB_LINEUP, 0)

SendMessage(lb1.Handle, WM_VSCROLL, SB_LINEUP, 0)

End Sub

End Class

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:b6**********************@news2.telusplanet.ne t...
Tree View or Checked List View do not have onVScroll event.
"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com> wrote in message news:%2****************@tk2msftngp13.phx.gbl...
> Your going to have to use the Windows API to make the other control

scroll
> down. Trap the onVScroll event of the control which you want to be the > master and have it send a message to the slave control.
>
> You need to use the User32.DLL and send a Message using the constant for > vertical scroll to the handle of the other control.
>
> HTH
>
>
>
> "Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message > news:GK**********************@news2.telusplanet.ne t...
> > I have a treeview and a checked list view controls one beside another. I
> > want to make them work so that when I scroll down or up one of

them the
> > other does the same.
> >
> > Any help will be appreciated
> >
> > --
> > Dino Buljubasic
> > Software Developer
> > http://rivusglobal.com
> >
> >
> >
>
>



Nov 20 '05 #6

P: n/a
I know, my point is that you CAN control the slave even though it didnt seem
to have that event, it did. It must have because otherwise the thing wouldnt
scroll.

However, I cant think how to trap the VScroll event of the TreeView. There
must be a way to do it though, I'll have a think or maybe someone else could
jump in.

Regards OHM

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:TD**********************@news2.telusplanet.ne t...
Thanks, but that one scroll only the label on the right. It does not scroll the rich text box on the left.

Is it possible to make them scroll both at the same time?
"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:u$**************@TK2MSFTNGP09.phx.gbl...
They are inherited from Control - Try this - I havent tried it for the

tree
control but this is a working example for the checked listbox ( This

works )

Regards OHM


--------------------------------------------------------------------------
--
----------------------------
Public Class Form1

Inherits System.Windows.Forms.Form

Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA"
(ByVal hWnd As IntPtr, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal
lParam As Int32) As Int32

Const WM_VSCROLL As Int32 = &H115

Const SB_LINEDOWN As Int32 = 1

Const SB_LINEUP As Int32 = 0

#Region " Windows Form Designer generated code "

Public Sub New()

MyBase.New()

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form 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.

Friend WithEvents PerformVscroll As System.Windows.Forms.Button

Friend WithEvents rtb2 As System.Windows.Forms.RichTextBox

Friend WithEvents ScrollUP As System.Windows.Forms.Button

Friend WithEvents lb1 As System.Windows.Forms.ListBox

<System.Diagnostics.DebuggerStepThrough()> Private Sub

InitializeComponent()

Me.PerformVscroll = New System.Windows.Forms.Button

Me.rtb2 = New System.Windows.Forms.RichTextBox

Me.ScrollUP = New System.Windows.Forms.Button

Me.lb1 = New System.Windows.Forms.ListBox

Me.SuspendLayout()

'

'PerformVscroll

'

Me.PerformVscroll.Location = New System.Drawing.Point(216, 192)

Me.PerformVscroll.Name = "PerformVscroll"

Me.PerformVscroll.Size = New System.Drawing.Size(104, 23)

Me.PerformVscroll.TabIndex = 2

Me.PerformVscroll.Text = "Scroll Up"

'

'rtb2

'

Me.rtb2.Location = New System.Drawing.Point(112, 120)

Me.rtb2.Name = "rtb2"

Me.rtb2.TabIndex = 3

Me.rtb2.Text = "RichTextBox1"

'

'ScrollUP

'

Me.ScrollUP.Location = New System.Drawing.Point(216, 120)

Me.ScrollUP.Name = "ScrollUP"

Me.ScrollUP.Size = New System.Drawing.Size(104, 23)

Me.ScrollUP.TabIndex = 4

Me.ScrollUP.Text = "Scroll UP"

'

'lb1

'

Me.lb1.Items.AddRange(New Object() {"1", "2", "3", "4", "5", "6", "7",

"8",
"10", "11", "12", "13", "14", "12", "13", "14", "15"})

Me.lb1.Location = New System.Drawing.Point(408, 96)

Me.lb1.Name = "lb1"

Me.lb1.Size = New System.Drawing.Size(120, 95)

Me.lb1.TabIndex = 5

'

'Form1

'

Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

Me.ClientSize = New System.Drawing.Size(680, 293)

Me.Controls.Add(Me.lb1)

Me.Controls.Add(Me.ScrollUP)

Me.Controls.Add(Me.rtb2)

Me.Controls.Add(Me.PerformVscroll)

Me.Name = "Form1"

Me.Text = "Form1"

Me.ResumeLayout(False)

End Sub

#End Region

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)

Dim ea As New EventArgs

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

rtb2.ScrollBars = RichTextBoxScrollBars.None

rtb2.Text +=

"RichTextBox1jkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjj khkjhgjghjgjkhkhgjkhgkjjkh

kjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkj hgjghjgjkhkhgjkhgkjjkhkjhg

jghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjg hjgjkhkhgjkhgkjjkhkjhgjghj

gjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgj khkhgjkhgkjjkhkjhgjghjgjkh

khgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkh gjkhgkjjkhkjhgjghjgjkhkhgj

khgkjjkhkjhgjghJJJJJkjjkhkjhgjghjgjkhkhgjkhgkjjkhk jhgjghjgjkhkhgjkhgkjjkhkjh

gjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgj ghjgjkhkhgjkhgkjjkhkjhgjgh
jgjkhkhgjkhgkjjkhkjhgjghjgjkhkhCCCCCC*******CCCCCC "

End Sub

Private Sub PerformScroll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PerformVscroll.Click

'SendMessage(rtb2.Handle, WM_VSCROLL, SB_LINEDOWN, 0)

SendMessage(lb1.Handle, WM_VSCROLL, SB_LINEDOWN, 0)

End Sub

Private Sub handleScroll(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles rtb2.VScroll

Console.WriteLine("Scrolling")

End Sub

Private Sub ScrollUP_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ScrollUP.Click

'SendMessage(rtb2.Handle, WM_VSCROLL, SB_LINEUP, 0)

SendMessage(lb1.Handle, WM_VSCROLL, SB_LINEUP, 0)

End Sub

End Class

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:b6**********************@news2.telusplanet.ne t...
Tree View or Checked List View do not have onVScroll event.
"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com> wrote in message news:%2****************@tk2msftngp13.phx.gbl...
> Your going to have to use the Windows API to make the other control

scroll
> down. Trap the onVScroll event of the control which you want to be the > master and have it send a message to the slave control.
>
> You need to use the User32.DLL and send a Message using the constant for > vertical scroll to the handle of the other control.
>
> HTH
>
>
>
> "Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message > news:GK**********************@news2.telusplanet.ne t...
> > I have a treeview and a checked list view controls one beside another. I
> > want to make them work so that when I scroll down or up one of

them the
> > other does the same.
> >
> > Any help will be appreciated
> >
> > --
> > Dino Buljubasic
> > Software Developer
> > http://rivusglobal.com
> >
> >
> >
>
>



Nov 20 '05 #7

P: n/a
It does work, I just tried it
"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:fK**********************@news2.telusplanet.ne t...
Ok, I got it. I just have to send the message to the other controls as
well. I'll try this with the tree view and checked list view to check.

I appreciate your help.
--
Dino Buljubasic
Software Developer
http://rivusglobal.com

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:TD**********************@news2.telusplanet.ne t...
Thanks, but that one scroll only the label on the right. It does not

scroll
the rich text box on the left.

Is it possible to make them scroll both at the same time?
"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:u$**************@TK2MSFTNGP09.phx.gbl...
They are inherited from Control - Try this - I havent tried it for the

tree
control but this is a working example for the checked listbox ( This

works )

Regards OHM


--------------------------------------------------------------------------
--
----------------------------
Public Class Form1

Inherits System.Windows.Forms.Form

Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As IntPtr, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Int32

Const WM_VSCROLL As Int32 = &H115

Const SB_LINEDOWN As Int32 = 1

Const SB_LINEUP As Int32 = 0

#Region " Windows Form Designer generated code "

Public Sub New()

MyBase.New()

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form 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.

Friend WithEvents PerformVscroll As System.Windows.Forms.Button

Friend WithEvents rtb2 As System.Windows.Forms.RichTextBox

Friend WithEvents ScrollUP As System.Windows.Forms.Button

Friend WithEvents lb1 As System.Windows.Forms.ListBox

<System.Diagnostics.DebuggerStepThrough()> Private Sub

InitializeComponent()

Me.PerformVscroll = New System.Windows.Forms.Button

Me.rtb2 = New System.Windows.Forms.RichTextBox

Me.ScrollUP = New System.Windows.Forms.Button

Me.lb1 = New System.Windows.Forms.ListBox

Me.SuspendLayout()

'

'PerformVscroll

'

Me.PerformVscroll.Location = New System.Drawing.Point(216, 192)

Me.PerformVscroll.Name = "PerformVscroll"

Me.PerformVscroll.Size = New System.Drawing.Size(104, 23)

Me.PerformVscroll.TabIndex = 2

Me.PerformVscroll.Text = "Scroll Up"

'

'rtb2

'

Me.rtb2.Location = New System.Drawing.Point(112, 120)

Me.rtb2.Name = "rtb2"

Me.rtb2.TabIndex = 3

Me.rtb2.Text = "RichTextBox1"

'

'ScrollUP

'

Me.ScrollUP.Location = New System.Drawing.Point(216, 120)

Me.ScrollUP.Name = "ScrollUP"

Me.ScrollUP.Size = New System.Drawing.Size(104, 23)

Me.ScrollUP.TabIndex = 4

Me.ScrollUP.Text = "Scroll UP"

'

'lb1

'

Me.lb1.Items.AddRange(New Object() {"1", "2", "3", "4", "5", "6", "7",

"8",
"10", "11", "12", "13", "14", "12", "13", "14", "15"})

Me.lb1.Location = New System.Drawing.Point(408, 96)

Me.lb1.Name = "lb1"

Me.lb1.Size = New System.Drawing.Size(120, 95)

Me.lb1.TabIndex = 5

'

'Form1

'

Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

Me.ClientSize = New System.Drawing.Size(680, 293)

Me.Controls.Add(Me.lb1)

Me.Controls.Add(Me.ScrollUP)

Me.Controls.Add(Me.rtb2)

Me.Controls.Add(Me.PerformVscroll)

Me.Name = "Form1"

Me.Text = "Form1"

Me.ResumeLayout(False)

End Sub

#End Region

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)

Dim ea As New EventArgs

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

rtb2.ScrollBars = RichTextBoxScrollBars.None

rtb2.Text +=

"RichTextBox1jkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjj khkjhgjghjgjkhkhgjkhgkjjkh

kjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkj hgjghjgjkhkhgjkhgkjjkhkjhg

jghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjg hjgjkhkhgjkhgkjjkhkjhgjghj

gjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgj khkhgjkhgkjjkhkjhgjghjgjkh

khgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkh gjkhgkjjkhkjhgjghjgjkhkhgj

khgkjjkhkjhgjghJJJJJkjjkhkjhgjghjgjkhkhgjkhgkjjkhk jhgjghjgjkhkhgjkhgkjjkhkjh

gjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgj ghjgjkhkhgjkhgkjjkhkjhgjgh
jgjkhkhgjkhgkjjkhkjhgjghjgjkhkhCCCCCC*******CCCCCC "

End Sub

Private Sub PerformScroll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PerformVscroll.Click

'SendMessage(rtb2.Handle, WM_VSCROLL, SB_LINEDOWN, 0)

SendMessage(lb1.Handle, WM_VSCROLL, SB_LINEDOWN, 0)

End Sub

Private Sub handleScroll(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles rtb2.VScroll

Console.WriteLine("Scrolling")

End Sub

Private Sub ScrollUP_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ScrollUP.Click

'SendMessage(rtb2.Handle, WM_VSCROLL, SB_LINEUP, 0)

SendMessage(lb1.Handle, WM_VSCROLL, SB_LINEUP, 0)

End Sub

End Class

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message news:b6**********************@news2.telusplanet.ne t...
> Tree View or Checked List View do not have onVScroll event.
>
>
> "One Handed Man [ OHM ]" <te***************************@BTOpenworld.com> > wrote in message news:%2****************@tk2msftngp13.phx.gbl...
> > Your going to have to use the Windows API to make the other control scroll
> > down. Trap the onVScroll event of the control which you want to be the > > master and have it send a message to the slave control.
> >
> > You need to use the User32.DLL and send a Message using the
constant
for
> > vertical scroll to the handle of the other control.
> >
> > HTH
> >
> >
> >
> > "Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in

message
> > news:GK**********************@news2.telusplanet.ne t...
> > > I have a treeview and a checked list view controls one beside

another.
> I
> > > want to make them work so that when I scroll down or up one of

them the
> > > other does the same.
> > >
> > > Any help will be appreciated
> > >
> > > --
> > > Dino Buljubasic
> > > Software Developer
> > > http://rivusglobal.com
> > >
> > >
> > >
> >
> >
>
>



Nov 20 '05 #8

P: n/a
Yes, it does. Thank you. Do you know how can I make the scrollbars
invisible, so I can use only the buttons?

Thank you

--
Dino Buljubasic
Software Developer
http://rivusglobal.com

"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:uu**************@tk2msftngp13.phx.gbl...
I know, my point is that you CAN control the slave even though it didnt seem to have that event, it did. It must have because otherwise the thing wouldnt scroll.

However, I cant think how to trap the VScroll event of the TreeView. There
must be a way to do it though, I'll have a think or maybe someone else could jump in.

Regards OHM

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:TD**********************@news2.telusplanet.ne t...
Thanks, but that one scroll only the label on the right. It does not

scroll
the rich text box on the left.

Is it possible to make them scroll both at the same time?
"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:u$**************@TK2MSFTNGP09.phx.gbl...
They are inherited from Control - Try this - I havent tried it for the

tree
control but this is a working example for the checked listbox ( This

works )

Regards OHM


--------------------------------------------------------------------------
--
----------------------------
Public Class Form1

Inherits System.Windows.Forms.Form

Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As IntPtr, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Int32

Const WM_VSCROLL As Int32 = &H115

Const SB_LINEDOWN As Int32 = 1

Const SB_LINEUP As Int32 = 0

#Region " Windows Form Designer generated code "

Public Sub New()

MyBase.New()

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form 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.

Friend WithEvents PerformVscroll As System.Windows.Forms.Button

Friend WithEvents rtb2 As System.Windows.Forms.RichTextBox

Friend WithEvents ScrollUP As System.Windows.Forms.Button

Friend WithEvents lb1 As System.Windows.Forms.ListBox

<System.Diagnostics.DebuggerStepThrough()> Private Sub

InitializeComponent()

Me.PerformVscroll = New System.Windows.Forms.Button

Me.rtb2 = New System.Windows.Forms.RichTextBox

Me.ScrollUP = New System.Windows.Forms.Button

Me.lb1 = New System.Windows.Forms.ListBox

Me.SuspendLayout()

'

'PerformVscroll

'

Me.PerformVscroll.Location = New System.Drawing.Point(216, 192)

Me.PerformVscroll.Name = "PerformVscroll"

Me.PerformVscroll.Size = New System.Drawing.Size(104, 23)

Me.PerformVscroll.TabIndex = 2

Me.PerformVscroll.Text = "Scroll Up"

'

'rtb2

'

Me.rtb2.Location = New System.Drawing.Point(112, 120)

Me.rtb2.Name = "rtb2"

Me.rtb2.TabIndex = 3

Me.rtb2.Text = "RichTextBox1"

'

'ScrollUP

'

Me.ScrollUP.Location = New System.Drawing.Point(216, 120)

Me.ScrollUP.Name = "ScrollUP"

Me.ScrollUP.Size = New System.Drawing.Size(104, 23)

Me.ScrollUP.TabIndex = 4

Me.ScrollUP.Text = "Scroll UP"

'

'lb1

'

Me.lb1.Items.AddRange(New Object() {"1", "2", "3", "4", "5", "6", "7",

"8",
"10", "11", "12", "13", "14", "12", "13", "14", "15"})

Me.lb1.Location = New System.Drawing.Point(408, 96)

Me.lb1.Name = "lb1"

Me.lb1.Size = New System.Drawing.Size(120, 95)

Me.lb1.TabIndex = 5

'

'Form1

'

Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

Me.ClientSize = New System.Drawing.Size(680, 293)

Me.Controls.Add(Me.lb1)

Me.Controls.Add(Me.ScrollUP)

Me.Controls.Add(Me.rtb2)

Me.Controls.Add(Me.PerformVscroll)

Me.Name = "Form1"

Me.Text = "Form1"

Me.ResumeLayout(False)

End Sub

#End Region

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)

Dim ea As New EventArgs

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

rtb2.ScrollBars = RichTextBoxScrollBars.None

rtb2.Text +=

"RichTextBox1jkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjj khkjhgjghjgjkhkhgjkhgkjjkh

kjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkj hgjghjgjkhkhgjkhgkjjkhkjhg

jghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjg hjgjkhkhgjkhgkjjkhkjhgjghj

gjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgj khkhgjkhgkjjkhkjhgjghjgjkh

khgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkh gjkhgkjjkhkjhgjghjgjkhkhgj

khgkjjkhkjhgjghJJJJJkjjkhkjhgjghjgjkhkhgjkhgkjjkhk jhgjghjgjkhkhgjkhgkjjkhkjh

gjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgj ghjgjkhkhgjkhgkjjkhkjhgjgh
jgjkhkhgjkhgkjjkhkjhgjghjgjkhkhCCCCCC*******CCCCCC "

End Sub

Private Sub PerformScroll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PerformVscroll.Click

'SendMessage(rtb2.Handle, WM_VSCROLL, SB_LINEDOWN, 0)

SendMessage(lb1.Handle, WM_VSCROLL, SB_LINEDOWN, 0)

End Sub

Private Sub handleScroll(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles rtb2.VScroll

Console.WriteLine("Scrolling")

End Sub

Private Sub ScrollUP_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ScrollUP.Click

'SendMessage(rtb2.Handle, WM_VSCROLL, SB_LINEUP, 0)

SendMessage(lb1.Handle, WM_VSCROLL, SB_LINEUP, 0)

End Sub

End Class

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message news:b6**********************@news2.telusplanet.ne t...
> Tree View or Checked List View do not have onVScroll event.
>
>
> "One Handed Man [ OHM ]" <te***************************@BTOpenworld.com> > wrote in message news:%2****************@tk2msftngp13.phx.gbl...
> > Your going to have to use the Windows API to make the other control scroll
> > down. Trap the onVScroll event of the control which you want to be the > > master and have it send a message to the slave control.
> >
> > You need to use the User32.DLL and send a Message using the
constant
for
> > vertical scroll to the handle of the other control.
> >
> > HTH
> >
> >
> >
> > "Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in

message
> > news:GK**********************@news2.telusplanet.ne t...
> > > I have a treeview and a checked list view controls one beside

another.
> I
> > > want to make them work so that when I scroll down or up one of

them the
> > > other does the same.
> > >
> > > Any help will be appreciated
> > >
> > > --
> > > Dino Buljubasic
> > > Software Developer
> > > http://rivusglobal.com
> > >
> > >
> > >
> >
> >
>
>



Nov 20 '05 #9

P: n/a
They both behave differently. The TreeView has a scrollable peroperty which
hides the scrollbars, but it stops remote scrolling. the Listbox scrollbars
cannot be disabled.

Thats It
"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:p6**********************@news2.telusplanet.ne t...
Yes, it does. Thank you. Do you know how can I make the scrollbars
invisible, so I can use only the buttons?

Thank you

--
Dino Buljubasic
Software Developer
http://rivusglobal.com

"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:uu**************@tk2msftngp13.phx.gbl...
I know, my point is that you CAN control the slave even though it didnt

seem
to have that event, it did. It must have because otherwise the thing

wouldnt
scroll.

However, I cant think how to trap the VScroll event of the TreeView. There
must be a way to do it though, I'll have a think or maybe someone else

could
jump in.

Regards OHM

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:TD**********************@news2.telusplanet.ne t...
Thanks, but that one scroll only the label on the right. It does not

scroll
the rich text box on the left.

Is it possible to make them scroll both at the same time?
"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com> wrote in message news:u$**************@TK2MSFTNGP09.phx.gbl...
> They are inherited from Control - Try this - I havent tried it for the tree
> control but this is a working example for the checked listbox ( This
works )
>
> Regards OHM


-------------------------------------------------------------------------- --
> ----------------------------
> Public Class Form1
>
> Inherits System.Windows.Forms.Form
>
> Private Declare Function SendMessage Lib "user32.dll" Alias

"SendMessageA"
> (ByVal hWnd As IntPtr, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal > lParam As Int32) As Int32
>
> Const WM_VSCROLL As Int32 = &H115
>
> Const SB_LINEDOWN As Int32 = 1
>
> Const SB_LINEUP As Int32 = 0
>
>
>
> #Region " Windows Form Designer generated code "
>
> Public Sub New()
>
> MyBase.New()
>
> 'This call is required by the Windows Form Designer.
>
> InitializeComponent()
>
> 'Add any initialization after the InitializeComponent() call
>
> End Sub
>
> 'Form 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.
>
> Friend WithEvents PerformVscroll As System.Windows.Forms.Button
>
> Friend WithEvents rtb2 As System.Windows.Forms.RichTextBox
>
> Friend WithEvents ScrollUP As System.Windows.Forms.Button
>
> Friend WithEvents lb1 As System.Windows.Forms.ListBox
>
> <System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
>
> Me.PerformVscroll = New System.Windows.Forms.Button
>
> Me.rtb2 = New System.Windows.Forms.RichTextBox
>
> Me.ScrollUP = New System.Windows.Forms.Button
>
> Me.lb1 = New System.Windows.Forms.ListBox
>
> Me.SuspendLayout()
>
> '
>
> 'PerformVscroll
>
> '
>
> Me.PerformVscroll.Location = New System.Drawing.Point(216, 192)
>
> Me.PerformVscroll.Name = "PerformVscroll"
>
> Me.PerformVscroll.Size = New System.Drawing.Size(104, 23)
>
> Me.PerformVscroll.TabIndex = 2
>
> Me.PerformVscroll.Text = "Scroll Up"
>
> '
>
> 'rtb2
>
> '
>
> Me.rtb2.Location = New System.Drawing.Point(112, 120)
>
> Me.rtb2.Name = "rtb2"
>
> Me.rtb2.TabIndex = 3
>
> Me.rtb2.Text = "RichTextBox1"
>
> '
>
> 'ScrollUP
>
> '
>
> Me.ScrollUP.Location = New System.Drawing.Point(216, 120)
>
> Me.ScrollUP.Name = "ScrollUP"
>
> Me.ScrollUP.Size = New System.Drawing.Size(104, 23)
>
> Me.ScrollUP.TabIndex = 4
>
> Me.ScrollUP.Text = "Scroll UP"
>
> '
>
> 'lb1
>
> '
>
> Me.lb1.Items.AddRange(New Object() {"1", "2", "3", "4", "5", "6", "7", "8",
> "10", "11", "12", "13", "14", "12", "13", "14", "15"})
>
> Me.lb1.Location = New System.Drawing.Point(408, 96)
>
> Me.lb1.Name = "lb1"
>
> Me.lb1.Size = New System.Drawing.Size(120, 95)
>
> Me.lb1.TabIndex = 5
>
> '
>
> 'Form1
>
> '
>
> Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
>
> Me.ClientSize = New System.Drawing.Size(680, 293)
>
> Me.Controls.Add(Me.lb1)
>
> Me.Controls.Add(Me.ScrollUP)
>
> Me.Controls.Add(Me.rtb2)
>
> Me.Controls.Add(Me.PerformVscroll)
>
> Me.Name = "Form1"
>
> Me.Text = "Form1"
>
> Me.ResumeLayout(False)
>
> End Sub
>
> #End Region
>
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs)
>
> Dim ea As New EventArgs
>
> End Sub
>
> Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
>
> rtb2.ScrollBars = RichTextBoxScrollBars.None
>
> rtb2.Text +=
>

"RichTextBox1jkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjj khkjhgjghjgjkhkhgjkhgkjjkh
>

kjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkj hgjghjgjkhkhgjkhgkjjkhkjhg
>

jghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjg hjgjkhkhgjkhgkjjkhkjhgjghj
>

gjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgj khkhgjkhgkjjkhkjhgjghjgjkh
>

khgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkh gjkhgkjjkhkjhgjghjgjkhkhgj
>

khgkjjkhkjhgjghJJJJJkjjkhkjhgjghjgjkhkhgjkhgkjjkhk jhgjghjgjkhkhgjkhgkjjkhkjh
>

gjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgj ghjgjkhkhgjkhgkjjkhkjhgjgh
> jgjkhkhgjkhgkjjkhkjhgjghjgjkhkhCCCCCC*******CCCCCC "
>
> End Sub
>
> Private Sub PerformScroll_Click(ByVal sender As System.Object, ByVal
e
As
> System.EventArgs) Handles PerformVscroll.Click
>
> 'SendMessage(rtb2.Handle, WM_VSCROLL, SB_LINEDOWN, 0)
>
> SendMessage(lb1.Handle, WM_VSCROLL, SB_LINEDOWN, 0)
>
> End Sub
>
> Private Sub handleScroll(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles rtb2.VScroll
>
> Console.WriteLine("Scrolling")
>
> End Sub
>
> Private Sub ScrollUP_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles ScrollUP.Click
>
> 'SendMessage(rtb2.Handle, WM_VSCROLL, SB_LINEUP, 0)
>
> SendMessage(lb1.Handle, WM_VSCROLL, SB_LINEUP, 0)
>
> End Sub
>
> End Class
>
>
>
>
>
> "Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message > news:b6**********************@news2.telusplanet.ne t...
> > Tree View or Checked List View do not have onVScroll event.
> >
> >
> > "One Handed Man [ OHM ]"

<te***************************@BTOpenworld.com>
> > wrote in message news:%2****************@tk2msftngp13.phx.gbl...
> > > Your going to have to use the Windows API to make the other control > scroll
> > > down. Trap the onVScroll event of the control which you want to
be the
> > > master and have it send a message to the slave control.
> > >
> > > You need to use the User32.DLL and send a Message using the

constant for
> > > vertical scroll to the handle of the other control.
> > >
> > > HTH
> > >
> > >
> > >
> > > "Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in
message
> > > news:GK**********************@news2.telusplanet.ne t...
> > > > I have a treeview and a checked list view controls one beside
another.
> > I
> > > > want to make them work so that when I scroll down or up one of

them
> the
> > > > other does the same.
> > > >
> > > > Any help will be appreciated
> > > >
> > > > --
> > > > Dino Buljubasic
> > > > Software Developer
> > > > http://rivusglobal.com
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 20 '05 #10

P: n/a
What about panel. I am actually using a panel with check boxes on it, not a
checked list view.

I am trying to find some references on my own, but MSDN does not says much.
I found somethig about scrollableClass with VScroll and HScroll properties
but don't know how to access them. I know that panel inherit from this
class, but don't know about treeview.

Tx
--
Dino Buljubasic
Software Developer
http://rivusglobal.com

"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:e6**************@tk2msftngp13.phx.gbl...
They both behave differently. The TreeView has a scrollable peroperty which hides the scrollbars, but it stops remote scrolling. the Listbox scrollbars cannot be disabled.

Thats It
"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:p6**********************@news2.telusplanet.ne t...
Yes, it does. Thank you. Do you know how can I make the scrollbars
invisible, so I can use only the buttons?

Thank you

--
Dino Buljubasic
Software Developer
http://rivusglobal.com

"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:uu**************@tk2msftngp13.phx.gbl...
I know, my point is that you CAN control the slave even though it didnt
seem
to have that event, it did. It must have because otherwise the thing wouldnt
scroll.

However, I cant think how to trap the VScroll event of the TreeView. There must be a way to do it though, I'll have a think or maybe someone else

could
jump in.

Regards OHM

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in
message news:TD**********************@news2.telusplanet.ne t...
> Thanks, but that one scroll only the label on the right. It does not scroll
> the rich text box on the left.
>
> Is it possible to make them scroll both at the same time?
>
>
> "One Handed Man [ OHM ]"

<te***************************@BTOpenworld.com> > wrote in message news:u$**************@TK2MSFTNGP09.phx.gbl...
> > They are inherited from Control - Try this - I havent tried it for the > tree
> > control but this is a working example for the checked listbox ( This > works )
> >
> > Regards OHM
>


--------------------------------------------------------------------------
> --
> > ----------------------------
> > Public Class Form1
> >
> > Inherits System.Windows.Forms.Form
> >
> > Private Declare Function SendMessage Lib "user32.dll" Alias
"SendMessageA"
> > (ByVal hWnd As IntPtr, ByVal wMsg As Int32, ByVal wParam As Int32,

ByVal
> > lParam As Int32) As Int32
> >
> > Const WM_VSCROLL As Int32 = &H115
> >
> > Const SB_LINEDOWN As Int32 = 1
> >
> > Const SB_LINEUP As Int32 = 0
> >
> >
> >
> > #Region " Windows Form Designer generated code "
> >
> > Public Sub New()
> >
> > MyBase.New()
> >
> > 'This call is required by the Windows Form Designer.
> >
> > InitializeComponent()
> >
> > 'Add any initialization after the InitializeComponent() call
> >
> > End Sub
> >
> > 'Form 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.
> >
> > Friend WithEvents PerformVscroll As System.Windows.Forms.Button
> >
> > Friend WithEvents rtb2 As System.Windows.Forms.RichTextBox
> >
> > Friend WithEvents ScrollUP As System.Windows.Forms.Button
> >
> > Friend WithEvents lb1 As System.Windows.Forms.ListBox
> >
> > <System.Diagnostics.DebuggerStepThrough()> Private Sub
> InitializeComponent()
> >
> > Me.PerformVscroll = New System.Windows.Forms.Button
> >
> > Me.rtb2 = New System.Windows.Forms.RichTextBox
> >
> > Me.ScrollUP = New System.Windows.Forms.Button
> >
> > Me.lb1 = New System.Windows.Forms.ListBox
> >
> > Me.SuspendLayout()
> >
> > '
> >
> > 'PerformVscroll
> >
> > '
> >
> > Me.PerformVscroll.Location = New System.Drawing.Point(216, 192)
> >
> > Me.PerformVscroll.Name = "PerformVscroll"
> >
> > Me.PerformVscroll.Size = New System.Drawing.Size(104, 23)
> >
> > Me.PerformVscroll.TabIndex = 2
> >
> > Me.PerformVscroll.Text = "Scroll Up"
> >
> > '
> >
> > 'rtb2
> >
> > '
> >
> > Me.rtb2.Location = New System.Drawing.Point(112, 120)
> >
> > Me.rtb2.Name = "rtb2"
> >
> > Me.rtb2.TabIndex = 3
> >
> > Me.rtb2.Text = "RichTextBox1"
> >
> > '
> >
> > 'ScrollUP
> >
> > '
> >
> > Me.ScrollUP.Location = New System.Drawing.Point(216, 120)
> >
> > Me.ScrollUP.Name = "ScrollUP"
> >
> > Me.ScrollUP.Size = New System.Drawing.Size(104, 23)
> >
> > Me.ScrollUP.TabIndex = 4
> >
> > Me.ScrollUP.Text = "Scroll UP"
> >
> > '
> >
> > 'lb1
> >
> > '
> >
> > Me.lb1.Items.AddRange(New Object() {"1", "2", "3", "4", "5", "6", "7", > "8",
> > "10", "11", "12", "13", "14", "12", "13", "14", "15"})
> >
> > Me.lb1.Location = New System.Drawing.Point(408, 96)
> >
> > Me.lb1.Name = "lb1"
> >
> > Me.lb1.Size = New System.Drawing.Size(120, 95)
> >
> > Me.lb1.TabIndex = 5
> >
> > '
> >
> > 'Form1
> >
> > '
> >
> > Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
> >
> > Me.ClientSize = New System.Drawing.Size(680, 293)
> >
> > Me.Controls.Add(Me.lb1)
> >
> > Me.Controls.Add(Me.ScrollUP)
> >
> > Me.Controls.Add(Me.rtb2)
> >
> > Me.Controls.Add(Me.PerformVscroll)
> >
> > Me.Name = "Form1"
> >
> > Me.Text = "Form1"
> >
> > Me.ResumeLayout(False)
> >
> > End Sub
> >
> > #End Region
> >
> > Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As > > System.EventArgs)
> >
> > Dim ea As New EventArgs
> >
> > End Sub
> >
> > Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Load
> >
> > rtb2.ScrollBars = RichTextBoxScrollBars.None
> >
> > rtb2.Text +=
> >
>

"RichTextBox1jkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjj khkjhgjghjgjkhkhgjkhgkjjkh
> >
>

kjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkj hgjghjgjkhkhgjkhgkjjkhkjhg
> >
>

jghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjg hjgjkhkhgjkhgkjjkhkjhgjghj
> >
>

gjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgj khkhgjkhgkjjkhkjhgjghjgjkh
> >
>

khgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkh gjkhgkjjkhkjhgjghjgjkhkhgj
> >
>

khgkjjkhkjhgjghJJJJJkjjkhkjhgjghjgjkhkhgjkhgkjjkhk jhgjghjgjkhkhgjkhgkjjkhkjh
> >
>

gjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgj ghjgjkhkhgjkhgkjjkhkjhgjgh
> > jgjkhkhgjkhgkjjkhkjhgjghjgjkhkhCCCCCC*******CCCCCC "
> >
> > End Sub
> >
> > Private Sub PerformScroll_Click(ByVal sender As System.Object, ByVal e
As
> > System.EventArgs) Handles PerformVscroll.Click
> >
> > 'SendMessage(rtb2.Handle, WM_VSCROLL, SB_LINEDOWN, 0)
> >
> > SendMessage(lb1.Handle, WM_VSCROLL, SB_LINEDOWN, 0)
> >
> > End Sub
> >
> > Private Sub handleScroll(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles rtb2.VScroll
> >
> > Console.WriteLine("Scrolling")
> >
> > End Sub
> >
> > Private Sub ScrollUP_Click(ByVal sender As System.Object, ByVal e
As > > System.EventArgs) Handles ScrollUP.Click
> >
> > 'SendMessage(rtb2.Handle, WM_VSCROLL, SB_LINEUP, 0)
> >
> > SendMessage(lb1.Handle, WM_VSCROLL, SB_LINEUP, 0)
> >
> > End Sub
> >
> > End Class
> >
> >
> >
> >
> >
> > "Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
> > news:b6**********************@news2.telusplanet.ne t...
> > > Tree View or Checked List View do not have onVScroll event.
> > >
> > >
> > > "One Handed Man [ OHM ]"
<te***************************@BTOpenworld.com>
> > > wrote in message news:%2****************@tk2msftngp13.phx.gbl...
> > > > Your going to have to use the Windows API to make the other

control
> > scroll
> > > > down. Trap the onVScroll event of the control which you want to be the
> > > > master and have it send a message to the slave control.
> > > >
> > > > You need to use the User32.DLL and send a Message using the

constant
> for
> > > > vertical scroll to the handle of the other control.
> > > >
> > > > HTH
> > > >
> > > >
> > > >
> > > > "Dino M. Buljubasic" <di*************@rivusglobal.com> wrote

in > message
> > > > news:GK**********************@news2.telusplanet.ne t...
> > > > > I have a treeview and a checked list view controls one beside > another.
> > > I
> > > > > want to make them work so that when I scroll down or up one of them
> > the
> > > > > other does the same.
> > > > >
> > > > > Any help will be appreciated
> > > > >
> > > > > --
> > > > > Dino Buljubasic
> > > > > Software Developer
> > > > > http://rivusglobal.com
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 20 '05 #11

P: n/a
I'm all used up tonight, need food.

Good Luck

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:nt**********************@news2.telusplanet.ne t...
What about panel. I am actually using a panel with check boxes on it, not a checked list view.

I am trying to find some references on my own, but MSDN does not says much. I found somethig about scrollableClass with VScroll and HScroll properties
but don't know how to access them. I know that panel inherit from this
class, but don't know about treeview.

Tx
--
Dino Buljubasic
Software Developer
http://rivusglobal.com

"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:e6**************@tk2msftngp13.phx.gbl...
They both behave differently. The TreeView has a scrollable peroperty which
hides the scrollbars, but it stops remote scrolling. the Listbox

scrollbars
cannot be disabled.

Thats It
"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:p6**********************@news2.telusplanet.ne t...
Yes, it does. Thank you. Do you know how can I make the scrollbars
invisible, so I can use only the buttons?

Thank you

--
Dino Buljubasic
Software Developer
http://rivusglobal.com

"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com> wrote in message news:uu**************@tk2msftngp13.phx.gbl...
> I know, my point is that you CAN control the slave even though it didnt seem
> to have that event, it did. It must have because otherwise the thing
wouldnt
> scroll.
>
> However, I cant think how to trap the VScroll event of the TreeView.

There
> must be a way to do it though, I'll have a think or maybe someone else could
> jump in.
>
> Regards OHM
>
>
>
>
>
> "Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message > news:TD**********************@news2.telusplanet.ne t...
> > Thanks, but that one scroll only the label on the right. It does not > scroll
> > the rich text box on the left.
> >
> > Is it possible to make them scroll both at the same time?
> >
> >
> > "One Handed Man [ OHM ]"

<te***************************@BTOpenworld.com>
> > wrote in message news:u$**************@TK2MSFTNGP09.phx.gbl...
> > > They are inherited from Control - Try this - I havent tried it for
the
> > tree
> > > control but this is a working example for the checked listbox ( This > > works )
> > >
> > > Regards OHM
> >
>


--------------------------------------------------------------------------
> > --
> > > ----------------------------
> > > Public Class Form1
> > >
> > > Inherits System.Windows.Forms.Form
> > >
> > > Private Declare Function SendMessage Lib "user32.dll" Alias
> "SendMessageA"
> > > (ByVal hWnd As IntPtr, ByVal wMsg As Int32, ByVal wParam As
Int32, ByVal
> > > lParam As Int32) As Int32
> > >
> > > Const WM_VSCROLL As Int32 = &H115
> > >
> > > Const SB_LINEDOWN As Int32 = 1
> > >
> > > Const SB_LINEUP As Int32 = 0
> > >
> > >
> > >
> > > #Region " Windows Form Designer generated code "
> > >
> > > Public Sub New()
> > >
> > > MyBase.New()
> > >
> > > 'This call is required by the Windows Form Designer.
> > >
> > > InitializeComponent()
> > >
> > > 'Add any initialization after the InitializeComponent() call
> > >
> > > End Sub
> > >
> > > 'Form 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.
> > >
> > > Friend WithEvents PerformVscroll As System.Windows.Forms.Button
> > >
> > > Friend WithEvents rtb2 As System.Windows.Forms.RichTextBox
> > >
> > > Friend WithEvents ScrollUP As System.Windows.Forms.Button
> > >
> > > Friend WithEvents lb1 As System.Windows.Forms.ListBox
> > >
> > > <System.Diagnostics.DebuggerStepThrough()> Private Sub
> > InitializeComponent()
> > >
> > > Me.PerformVscroll = New System.Windows.Forms.Button
> > >
> > > Me.rtb2 = New System.Windows.Forms.RichTextBox
> > >
> > > Me.ScrollUP = New System.Windows.Forms.Button
> > >
> > > Me.lb1 = New System.Windows.Forms.ListBox
> > >
> > > Me.SuspendLayout()
> > >
> > > '
> > >
> > > 'PerformVscroll
> > >
> > > '
> > >
> > > Me.PerformVscroll.Location = New System.Drawing.Point(216, 192)
> > >
> > > Me.PerformVscroll.Name = "PerformVscroll"
> > >
> > > Me.PerformVscroll.Size = New System.Drawing.Size(104, 23)
> > >
> > > Me.PerformVscroll.TabIndex = 2
> > >
> > > Me.PerformVscroll.Text = "Scroll Up"
> > >
> > > '
> > >
> > > 'rtb2
> > >
> > > '
> > >
> > > Me.rtb2.Location = New System.Drawing.Point(112, 120)
> > >
> > > Me.rtb2.Name = "rtb2"
> > >
> > > Me.rtb2.TabIndex = 3
> > >
> > > Me.rtb2.Text = "RichTextBox1"
> > >
> > > '
> > >
> > > 'ScrollUP
> > >
> > > '
> > >
> > > Me.ScrollUP.Location = New System.Drawing.Point(216, 120)
> > >
> > > Me.ScrollUP.Name = "ScrollUP"
> > >
> > > Me.ScrollUP.Size = New System.Drawing.Size(104, 23)
> > >
> > > Me.ScrollUP.TabIndex = 4
> > >
> > > Me.ScrollUP.Text = "Scroll UP"
> > >
> > > '
> > >
> > > 'lb1
> > >
> > > '
> > >
> > > Me.lb1.Items.AddRange(New Object() {"1", "2", "3", "4", "5", "6",
"7",
> > "8",
> > > "10", "11", "12", "13", "14", "12", "13", "14", "15"})
> > >
> > > Me.lb1.Location = New System.Drawing.Point(408, 96)
> > >
> > > Me.lb1.Name = "lb1"
> > >
> > > Me.lb1.Size = New System.Drawing.Size(120, 95)
> > >
> > > Me.lb1.TabIndex = 5
> > >
> > > '
> > >
> > > 'Form1
> > >
> > > '
> > >
> > > Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
> > >
> > > Me.ClientSize = New System.Drawing.Size(680, 293)
> > >
> > > Me.Controls.Add(Me.lb1)
> > >
> > > Me.Controls.Add(Me.ScrollUP)
> > >
> > > Me.Controls.Add(Me.rtb2)
> > >
> > > Me.Controls.Add(Me.PerformVscroll)
> > >
> > > Me.Name = "Form1"
> > >
> > > Me.Text = "Form1"
> > >
> > > Me.ResumeLayout(False)
> > >
> > > End Sub
> > >
> > > #End Region
> > >
> > > Private Sub Button1_Click(ByVal sender As System.Object, ByVal e

As > > > System.EventArgs)
> > >
> > > Dim ea As New EventArgs
> > >
> > > End Sub
> > >
> > > Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
> > > System.EventArgs) Handles MyBase.Load
> > >
> > > rtb2.ScrollBars = RichTextBoxScrollBars.None
> > >
> > > rtb2.Text +=
> > >
> >
>

"RichTextBox1jkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjj khkjhgjghjgjkhkhgjkhgkjjkh > > >
> >
>

kjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkj hgjghjgjkhkhgjkhgkjjkhkjhg
> > >
> >
>

jghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjg hjgjkhkhgjkhgkjjkhkjhgjghj
> > >
> >
>

gjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgj khkhgjkhgkjjkhkjhgjghjgjkh
> > >
> >
>

khgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkh gjkhgkjjkhkjhgjghjgjkhkhgj
> > >
> >
>

khgkjjkhkjhgjghJJJJJkjjkhkjhgjghjgjkhkhgjkhgkjjkhk jhgjghjgjkhkhgjkhgkjjkhkjh
> > >
> >
>

gjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgj ghjgjkhkhgjkhgkjjkhkjhgjgh
> > > jgjkhkhgjkhgkjjkhkjhgjghjgjkhkhCCCCCC*******CCCCCC "
> > >
> > > End Sub
> > >
> > > Private Sub PerformScroll_Click(ByVal sender As System.Object, ByVal
e
> As
> > > System.EventArgs) Handles PerformVscroll.Click
> > >
> > > 'SendMessage(rtb2.Handle, WM_VSCROLL, SB_LINEDOWN, 0)
> > >
> > > SendMessage(lb1.Handle, WM_VSCROLL, SB_LINEDOWN, 0)
> > >
> > > End Sub
> > >
> > > Private Sub handleScroll(ByVal sender As System.Object, ByVal e As > > > System.EventArgs) Handles rtb2.VScroll
> > >
> > > Console.WriteLine("Scrolling")
> > >
> > > End Sub
> > >
> > > Private Sub ScrollUP_Click(ByVal sender As System.Object, ByVal e As > > > System.EventArgs) Handles ScrollUP.Click
> > >
> > > 'SendMessage(rtb2.Handle, WM_VSCROLL, SB_LINEUP, 0)
> > >
> > > SendMessage(lb1.Handle, WM_VSCROLL, SB_LINEUP, 0)
> > >
> > > End Sub
> > >
> > > End Class
> > >
> > >
> > >
> > >
> > >
> > > "Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in
message
> > > news:b6**********************@news2.telusplanet.ne t...
> > > > Tree View or Checked List View do not have onVScroll event.
> > > >
> > > >
> > > > "One Handed Man [ OHM ]"
> <te***************************@BTOpenworld.com>
> > > > wrote in message
news:%2****************@tk2msftngp13.phx.gbl... > > > > > Your going to have to use the Windows API to make the other
control
> > > scroll
> > > > > down. Trap the onVScroll event of the control which you want
to
be
> the
> > > > > master and have it send a message to the slave control.
> > > > >
> > > > > You need to use the User32.DLL and send a Message using the
constant
> > for
> > > > > vertical scroll to the handle of the other control.
> > > > >
> > > > > HTH
> > > > >
> > > > >
> > > > >
> > > > > "Dino M. Buljubasic" <di*************@rivusglobal.com> wrote

in > > message
> > > > > news:GK**********************@news2.telusplanet.ne t...
> > > > > > I have a treeview and a checked list view controls one beside > > another.
> > > > I
> > > > > > want to make them work so that when I scroll down or up
one of > them
> > > the
> > > > > > other does the same.
> > > > > >
> > > > > > Any help will be appreciated
> > > > > >
> > > > > > --
> > > > > > Dino Buljubasic
> > > > > > Software Developer
> > > > > > http://rivusglobal.com
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 20 '05 #12

P: n/a
Thanks
"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:OA*************@TK2MSFTNGP12.phx.gbl...
I'm all used up tonight, need food.

Good Luck

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:nt**********************@news2.telusplanet.ne t...
What about panel. I am actually using a panel with check boxes on it, not
a
checked list view.

I am trying to find some references on my own, but MSDN does not says much.
I found somethig about scrollableClass with VScroll and HScroll properties but don't know how to access them. I know that panel inherit from this
class, but don't know about treeview.

Tx
--
Dino Buljubasic
Software Developer
http://rivusglobal.com

"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:e6**************@tk2msftngp13.phx.gbl...
They both behave differently. The TreeView has a scrollable peroperty

which
hides the scrollbars, but it stops remote scrolling. the Listbox

scrollbars
cannot be disabled.

Thats It
"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message news:p6**********************@news2.telusplanet.ne t...
> Yes, it does. Thank you. Do you know how can I make the scrollbars
> invisible, so I can use only the buttons?
>
> Thank you
>
> --
> Dino Buljubasic
> Software Developer
> http://rivusglobal.com
>
> "One Handed Man [ OHM ]" <te***************************@BTOpenworld.com> > wrote in message news:uu**************@tk2msftngp13.phx.gbl...
> > I know, my point is that you CAN control the slave even though it

didnt
> seem
> > to have that event, it did. It must have because otherwise the thing > wouldnt
> > scroll.
> >
> > However, I cant think how to trap the VScroll event of the TreeView. There
> > must be a way to do it though, I'll have a think or maybe someone else > could
> > jump in.
> >
> > Regards OHM
> >
> >
> >
> >
> >
> > "Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in

message
> > news:TD**********************@news2.telusplanet.ne t...
> > > Thanks, but that one scroll only the label on the right. It does not
> > scroll
> > > the rich text box on the left.
> > >
> > > Is it possible to make them scroll both at the same time?
> > >
> > >
> > > "One Handed Man [ OHM ]"
<te***************************@BTOpenworld.com>
> > > wrote in message news:u$**************@TK2MSFTNGP09.phx.gbl...
> > > > They are inherited from Control - Try this - I havent tried it for the
> > > tree
> > > > control but this is a working example for the checked listbox
(
This
> > > works )
> > > >
> > > > Regards OHM
> > >
> >
>


-------------------------------------------------------------------------- > > > --
> > > > ----------------------------
> > > > Public Class Form1
> > > >
> > > > Inherits System.Windows.Forms.Form
> > > >
> > > > Private Declare Function SendMessage Lib "user32.dll" Alias
> > "SendMessageA"
> > > > (ByVal hWnd As IntPtr, ByVal wMsg As Int32, ByVal wParam As Int32, > ByVal
> > > > lParam As Int32) As Int32
> > > >
> > > > Const WM_VSCROLL As Int32 = &H115
> > > >
> > > > Const SB_LINEDOWN As Int32 = 1
> > > >
> > > > Const SB_LINEUP As Int32 = 0
> > > >
> > > >
> > > >
> > > > #Region " Windows Form Designer generated code "
> > > >
> > > > Public Sub New()
> > > >
> > > > MyBase.New()
> > > >
> > > > 'This call is required by the Windows Form Designer.
> > > >
> > > > InitializeComponent()
> > > >
> > > > 'Add any initialization after the InitializeComponent() call
> > > >
> > > > End Sub
> > > >
> > > > 'Form 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.
> > > >
> > > > Friend WithEvents PerformVscroll As
System.Windows.Forms.Button > > > >
> > > > Friend WithEvents rtb2 As System.Windows.Forms.RichTextBox
> > > >
> > > > Friend WithEvents ScrollUP As System.Windows.Forms.Button
> > > >
> > > > Friend WithEvents lb1 As System.Windows.Forms.ListBox
> > > >
> > > > <System.Diagnostics.DebuggerStepThrough()> Private Sub
> > > InitializeComponent()
> > > >
> > > > Me.PerformVscroll = New System.Windows.Forms.Button
> > > >
> > > > Me.rtb2 = New System.Windows.Forms.RichTextBox
> > > >
> > > > Me.ScrollUP = New System.Windows.Forms.Button
> > > >
> > > > Me.lb1 = New System.Windows.Forms.ListBox
> > > >
> > > > Me.SuspendLayout()
> > > >
> > > > '
> > > >
> > > > 'PerformVscroll
> > > >
> > > > '
> > > >
> > > > Me.PerformVscroll.Location = New System.Drawing.Point(216, 192) > > > >
> > > > Me.PerformVscroll.Name = "PerformVscroll"
> > > >
> > > > Me.PerformVscroll.Size = New System.Drawing.Size(104, 23)
> > > >
> > > > Me.PerformVscroll.TabIndex = 2
> > > >
> > > > Me.PerformVscroll.Text = "Scroll Up"
> > > >
> > > > '
> > > >
> > > > 'rtb2
> > > >
> > > > '
> > > >
> > > > Me.rtb2.Location = New System.Drawing.Point(112, 120)
> > > >
> > > > Me.rtb2.Name = "rtb2"
> > > >
> > > > Me.rtb2.TabIndex = 3
> > > >
> > > > Me.rtb2.Text = "RichTextBox1"
> > > >
> > > > '
> > > >
> > > > 'ScrollUP
> > > >
> > > > '
> > > >
> > > > Me.ScrollUP.Location = New System.Drawing.Point(216, 120)
> > > >
> > > > Me.ScrollUP.Name = "ScrollUP"
> > > >
> > > > Me.ScrollUP.Size = New System.Drawing.Size(104, 23)
> > > >
> > > > Me.ScrollUP.TabIndex = 4
> > > >
> > > > Me.ScrollUP.Text = "Scroll UP"
> > > >
> > > > '
> > > >
> > > > 'lb1
> > > >
> > > > '
> > > >
> > > > Me.lb1.Items.AddRange(New Object() {"1", "2", "3", "4", "5", "6", "7",
> > > "8",
> > > > "10", "11", "12", "13", "14", "12", "13", "14", "15"})
> > > >
> > > > Me.lb1.Location = New System.Drawing.Point(408, 96)
> > > >
> > > > Me.lb1.Name = "lb1"
> > > >
> > > > Me.lb1.Size = New System.Drawing.Size(120, 95)
> > > >
> > > > Me.lb1.TabIndex = 5
> > > >
> > > > '
> > > >
> > > > 'Form1
> > > >
> > > > '
> > > >
> > > > Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
> > > >
> > > > Me.ClientSize = New System.Drawing.Size(680, 293)
> > > >
> > > > Me.Controls.Add(Me.lb1)
> > > >
> > > > Me.Controls.Add(Me.ScrollUP)
> > > >
> > > > Me.Controls.Add(Me.rtb2)
> > > >
> > > > Me.Controls.Add(Me.PerformVscroll)
> > > >
> > > > Me.Name = "Form1"
> > > >
> > > > Me.Text = "Form1"
> > > >
> > > > Me.ResumeLayout(False)
> > > >
> > > > End Sub
> > > >
> > > > #End Region
> > > >
> > > > Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> > > > System.EventArgs)
> > > >
> > > > Dim ea As New EventArgs
> > > >
> > > > End Sub
> > > >
> > > > Private Sub Form1_Load(ByVal sender As System.Object, ByVal e
As > > > > System.EventArgs) Handles MyBase.Load
> > > >
> > > > rtb2.ScrollBars = RichTextBoxScrollBars.None
> > > >
> > > > rtb2.Text +=
> > > >
> > >
> >
>

"RichTextBox1jkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjj khkjhgjghjgjkhkhgjkhgkjjkh
> > > >
> > >
> >
>

kjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkj hgjghjgjkhkhgjkhgkjjkhkjhg
> > > >
> > >
> >
>

jghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjg hjgjkhkhgjkhgkjjkhkjhgjghj
> > > >
> > >
> >
>

gjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgj khkhgjkhgkjjkhkjhgjghjgjkh
> > > >
> > >
> >
>

khgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkh gjkhgkjjkhkjhgjghjgjkhkhgj
> > > >
> > >
> >
>

khgkjjkhkjhgjghJJJJJkjjkhkjhgjghjgjkhkhgjkhgkjjkhk jhgjghjgjkhkhgjkhgkjjkhkjh
> > > >
> > >
> >
>

gjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgj ghjgjkhkhgjkhgkjjkhkjhgjgh
> > > > jgjkhkhgjkhgkjjkhkjhgjghjgjkhkhCCCCCC*******CCCCCC "
> > > >
> > > > End Sub
> > > >
> > > > Private Sub PerformScroll_Click(ByVal sender As System.Object,

ByVal
e
> > As
> > > > System.EventArgs) Handles PerformVscroll.Click
> > > >
> > > > 'SendMessage(rtb2.Handle, WM_VSCROLL, SB_LINEDOWN, 0)
> > > >
> > > > SendMessage(lb1.Handle, WM_VSCROLL, SB_LINEDOWN, 0)
> > > >
> > > > End Sub
> > > >
> > > > Private Sub handleScroll(ByVal sender As System.Object, ByVal e As
> > > > System.EventArgs) Handles rtb2.VScroll
> > > >
> > > > Console.WriteLine("Scrolling")
> > > >
> > > > End Sub
> > > >
> > > > Private Sub ScrollUP_Click(ByVal sender As System.Object,
ByVal
e
As
> > > > System.EventArgs) Handles ScrollUP.Click
> > > >
> > > > 'SendMessage(rtb2.Handle, WM_VSCROLL, SB_LINEUP, 0)
> > > >
> > > > SendMessage(lb1.Handle, WM_VSCROLL, SB_LINEUP, 0)
> > > >
> > > > End Sub
> > > >
> > > > End Class
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > "Dino M. Buljubasic" <di*************@rivusglobal.com> wrote
in > message
> > > > news:b6**********************@news2.telusplanet.ne t...
> > > > > Tree View or Checked List View do not have onVScroll event.
> > > > >
> > > > >
> > > > > "One Handed Man [ OHM ]"
> > <te***************************@BTOpenworld.com>
> > > > > wrote in message

news:%2****************@tk2msftngp13.phx.gbl... > > > > > > Your going to have to use the Windows API to make the other > control
> > > > scroll
> > > > > > down. Trap the onVScroll event of the control which you want to
be
> > the
> > > > > > master and have it send a message to the slave control.
> > > > > >
> > > > > > You need to use the User32.DLL and send a Message using
the > constant
> > > for
> > > > > > vertical scroll to the handle of the other control.
> > > > > >
> > > > > > HTH
> > > > > >
> > > > > >
> > > > > >
> > > > > > "Dino M. Buljubasic" <di*************@rivusglobal.com>

wrote in
> > > message
> > > > > > news:GK**********************@news2.telusplanet.ne t...
> > > > > > > I have a treeview and a checked list view controls one

beside
> > > another.
> > > > > I
> > > > > > > want to make them work so that when I scroll down or up

one
of
> > them
> > > > the
> > > > > > > other does the same.
> > > > > > >
> > > > > > > Any help will be appreciated
> > > > > > >
> > > > > > > --
> > > > > > > Dino Buljubasic
> > > > > > > Software Developer
> > > > > > > http://rivusglobal.com
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 20 '05 #13

P: n/a
Hi,

I got a very simple sollution to this.

Put your controls simply into a panel Control, sets its property AutoScroll
to True.

The two controls inside the panel, say another pannel holding checkboxes and
a treeview should have their properties AutoScroll and Scrollable
respectively set to False.

Since panel inherits from ScrollableControl class, the two controls inside
will do the same. Therefore, no need for them to have their own scroll
bars.
--
Dino Buljubasic
Software Developer
http://rivusglobal.com

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:6C**********************@news2.telusplanet.ne t...
Thanks
"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:OA*************@TK2MSFTNGP12.phx.gbl...
I'm all used up tonight, need food.

Good Luck

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:nt**********************@news2.telusplanet.ne t...
What about panel. I am actually using a panel with check boxes on it, not
a
checked list view.

I am trying to find some references on my own, but MSDN does not says much.
I found somethig about scrollableClass with VScroll and HScroll properties but don't know how to access them. I know that panel inherit from this class, but don't know about treeview.

Tx
--
Dino Buljubasic
Software Developer
http://rivusglobal.com

"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com> wrote in message news:e6**************@tk2msftngp13.phx.gbl...
> They both behave differently. The TreeView has a scrollable peroperty which
> hides the scrollbars, but it stops remote scrolling. the Listbox
scrollbars
> cannot be disabled.
>
> Thats It
>
>
> "Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message > news:p6**********************@news2.telusplanet.ne t...
> > Yes, it does. Thank you. Do you know how can I make the scrollbars > > invisible, so I can use only the buttons?
> >
> > Thank you
> >
> > --
> > Dino Buljubasic
> > Software Developer
> > http://rivusglobal.com
> >
> > "One Handed Man [ OHM ]"

<te***************************@BTOpenworld.com>
> > wrote in message news:uu**************@tk2msftngp13.phx.gbl...
> > > I know, my point is that you CAN control the slave even though it didnt
> > seem
> > > to have that event, it did. It must have because otherwise the thing > > wouldnt
> > > scroll.
> > >
> > > However, I cant think how to trap the VScroll event of the TreeView. > There
> > > must be a way to do it though, I'll have a think or maybe someone else
> > could
> > > jump in.
> > >
> > > Regards OHM
> > >
> > >
> > >
> > >
> > >
> > > "Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in
message
> > > news:TD**********************@news2.telusplanet.ne t...
> > > > Thanks, but that one scroll only the label on the right. It does not
> > > scroll
> > > > the rich text box on the left.
> > > >
> > > > Is it possible to make them scroll both at the same time?
> > > >
> > > >
> > > > "One Handed Man [ OHM ]"
> <te***************************@BTOpenworld.com>
> > > > wrote in message news:u$**************@TK2MSFTNGP09.phx.gbl...
> > > > > They are inherited from Control - Try this - I havent tried
it
for
> the
> > > > tree
> > > > > control but this is a working example for the checked
listbox ( This
> > > > works )
> > > > >
> > > > > Regards OHM
> > > >
> > >
> >
>


--------------------------------------------------------------------------
> > > > --
> > > > > ----------------------------
> > > > > Public Class Form1
> > > > >
> > > > > Inherits System.Windows.Forms.Form
> > > > >
> > > > > Private Declare Function SendMessage Lib "user32.dll" Alias
> > > "SendMessageA"
> > > > > (ByVal hWnd As IntPtr, ByVal wMsg As Int32, ByVal wParam As

Int32,
> > ByVal
> > > > > lParam As Int32) As Int32
> > > > >
> > > > > Const WM_VSCROLL As Int32 = &H115
> > > > >
> > > > > Const SB_LINEDOWN As Int32 = 1
> > > > >
> > > > > Const SB_LINEUP As Int32 = 0
> > > > >
> > > > >
> > > > >
> > > > > #Region " Windows Form Designer generated code "
> > > > >
> > > > > Public Sub New()
> > > > >
> > > > > MyBase.New()
> > > > >
> > > > > 'This call is required by the Windows Form Designer.
> > > > >
> > > > > InitializeComponent()
> > > > >
> > > > > 'Add any initialization after the InitializeComponent() call
> > > > >
> > > > > End Sub
> > > > >
> > > > > 'Form 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.
> > > > >
> > > > > Friend WithEvents PerformVscroll As

System.Windows.Forms.Button > > > > >
> > > > > Friend WithEvents rtb2 As System.Windows.Forms.RichTextBox
> > > > >
> > > > > Friend WithEvents ScrollUP As System.Windows.Forms.Button
> > > > >
> > > > > Friend WithEvents lb1 As System.Windows.Forms.ListBox
> > > > >
> > > > > <System.Diagnostics.DebuggerStepThrough()> Private Sub
> > > > InitializeComponent()
> > > > >
> > > > > Me.PerformVscroll = New System.Windows.Forms.Button
> > > > >
> > > > > Me.rtb2 = New System.Windows.Forms.RichTextBox
> > > > >
> > > > > Me.ScrollUP = New System.Windows.Forms.Button
> > > > >
> > > > > Me.lb1 = New System.Windows.Forms.ListBox
> > > > >
> > > > > Me.SuspendLayout()
> > > > >
> > > > > '
> > > > >
> > > > > 'PerformVscroll
> > > > >
> > > > > '
> > > > >
> > > > > Me.PerformVscroll.Location = New System.Drawing.Point(216, 192) > > > > >
> > > > > Me.PerformVscroll.Name = "PerformVscroll"
> > > > >
> > > > > Me.PerformVscroll.Size = New System.Drawing.Size(104, 23)
> > > > >
> > > > > Me.PerformVscroll.TabIndex = 2
> > > > >
> > > > > Me.PerformVscroll.Text = "Scroll Up"
> > > > >
> > > > > '
> > > > >
> > > > > 'rtb2
> > > > >
> > > > > '
> > > > >
> > > > > Me.rtb2.Location = New System.Drawing.Point(112, 120)
> > > > >
> > > > > Me.rtb2.Name = "rtb2"
> > > > >
> > > > > Me.rtb2.TabIndex = 3
> > > > >
> > > > > Me.rtb2.Text = "RichTextBox1"
> > > > >
> > > > > '
> > > > >
> > > > > 'ScrollUP
> > > > >
> > > > > '
> > > > >
> > > > > Me.ScrollUP.Location = New System.Drawing.Point(216, 120)
> > > > >
> > > > > Me.ScrollUP.Name = "ScrollUP"
> > > > >
> > > > > Me.ScrollUP.Size = New System.Drawing.Size(104, 23)
> > > > >
> > > > > Me.ScrollUP.TabIndex = 4
> > > > >
> > > > > Me.ScrollUP.Text = "Scroll UP"
> > > > >
> > > > > '
> > > > >
> > > > > 'lb1
> > > > >
> > > > > '
> > > > >
> > > > > Me.lb1.Items.AddRange(New Object() {"1", "2", "3", "4", "5",

"6",
> "7",
> > > > "8",
> > > > > "10", "11", "12", "13", "14", "12", "13", "14", "15"})
> > > > >
> > > > > Me.lb1.Location = New System.Drawing.Point(408, 96)
> > > > >
> > > > > Me.lb1.Name = "lb1"
> > > > >
> > > > > Me.lb1.Size = New System.Drawing.Size(120, 95)
> > > > >
> > > > > Me.lb1.TabIndex = 5
> > > > >
> > > > > '
> > > > >
> > > > > 'Form1
> > > > >
> > > > > '
> > > > >
> > > > > Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
> > > > >
> > > > > Me.ClientSize = New System.Drawing.Size(680, 293)
> > > > >
> > > > > Me.Controls.Add(Me.lb1)
> > > > >
> > > > > Me.Controls.Add(Me.ScrollUP)
> > > > >
> > > > > Me.Controls.Add(Me.rtb2)
> > > > >
> > > > > Me.Controls.Add(Me.PerformVscroll)
> > > > >
> > > > > Me.Name = "Form1"
> > > > >
> > > > > Me.Text = "Form1"
> > > > >
> > > > > Me.ResumeLayout(False)
> > > > >
> > > > > End Sub
> > > > >
> > > > > #End Region
> > > > >
> > > > > Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As
> > > > > System.EventArgs)
> > > > >
> > > > > Dim ea As New EventArgs
> > > > >
> > > > > End Sub
> > > > >
> > > > > Private Sub Form1_Load(ByVal sender As System.Object, ByVal
e
As > > > > > System.EventArgs) Handles MyBase.Load
> > > > >
> > > > > rtb2.ScrollBars = RichTextBoxScrollBars.None
> > > > >
> > > > > rtb2.Text +=
> > > > >
> > > >
> > >
> >
>

"RichTextBox1jkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjj khkjhgjghjgjkhkhgjkhgkjjkh > > > > >
> > > >
> > >
> >
>

kjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkj hgjghjgjkhkhgjkhgkjjkhkjhg
> > > > >
> > > >
> > >
> >
>

jghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjg hjgjkhkhgjkhgkjjkhkjhgjghj
> > > > >
> > > >
> > >
> >
>

gjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgj khkhgjkhgkjjkhkjhgjghjgjkh
> > > > >
> > > >
> > >
> >
>

khgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkh gjkhgkjjkhkjhgjghjgjkhkhgj
> > > > >
> > > >
> > >
> >
>

khgkjjkhkjhgjghJJJJJkjjkhkjhgjghjgjkhkhgjkhgkjjkhk jhgjghjgjkhkhgjkhgkjjkhkjh
> > > > >
> > > >
> > >
> >
>

gjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgj ghjgjkhkhgjkhgkjjkhkjhgjgh
> > > > > jgjkhkhgjkhgkjjkhkjhgjghjgjkhkhCCCCCC*******CCCCCC "
> > > > >
> > > > > End Sub
> > > > >
> > > > > Private Sub PerformScroll_Click(ByVal sender As System.Object, ByVal
> e
> > > As
> > > > > System.EventArgs) Handles PerformVscroll.Click
> > > > >
> > > > > 'SendMessage(rtb2.Handle, WM_VSCROLL, SB_LINEDOWN, 0)
> > > > >
> > > > > SendMessage(lb1.Handle, WM_VSCROLL, SB_LINEDOWN, 0)
> > > > >
> > > > > End Sub
> > > > >
> > > > > Private Sub handleScroll(ByVal sender As System.Object, ByVal e
As
> > > > > System.EventArgs) Handles rtb2.VScroll
> > > > >
> > > > > Console.WriteLine("Scrolling")
> > > > >
> > > > > End Sub
> > > > >
> > > > > Private Sub ScrollUP_Click(ByVal sender As System.Object, ByVal
e
As
> > > > > System.EventArgs) Handles ScrollUP.Click
> > > > >
> > > > > 'SendMessage(rtb2.Handle, WM_VSCROLL, SB_LINEUP, 0)
> > > > >
> > > > > SendMessage(lb1.Handle, WM_VSCROLL, SB_LINEUP, 0)
> > > > >
> > > > > End Sub
> > > > >
> > > > > End Class
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > "Dino M. Buljubasic" <di*************@rivusglobal.com> wrote

in > > message
> > > > > news:b6**********************@news2.telusplanet.ne t...
> > > > > > Tree View or Checked List View do not have onVScroll
event. > > > > > >
> > > > > >
> > > > > > "One Handed Man [ OHM ]"
> > > <te***************************@BTOpenworld.com>
> > > > > > wrote in message

news:%2****************@tk2msftngp13.phx.gbl...
> > > > > > > Your going to have to use the Windows API to make the

other > > control
> > > > > scroll
> > > > > > > down. Trap the onVScroll event of the control which you want to
> be
> > > the
> > > > > > > master and have it send a message to the slave control.
> > > > > > >
> > > > > > > You need to use the User32.DLL and send a Message using the > > constant
> > > > for
> > > > > > > vertical scroll to the handle of the other control.
> > > > > > >
> > > > > > > HTH
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > "Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in
> > > > message
> > > > > > > news:GK**********************@news2.telusplanet.ne t...
> > > > > > > > I have a treeview and a checked list view controls one
beside
> > > > another.
> > > > > > I
> > > > > > > > want to make them work so that when I scroll down or

up one
of
> > > them
> > > > > the
> > > > > > > > other does the same.
> > > > > > > >
> > > > > > > > Any help will be appreciated
> > > > > > > >
> > > > > > > > --
> > > > > > > > Dino Buljubasic
> > > > > > > > Software Developer
> > > > > > > > http://rivusglobal.com
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 20 '05 #14

P: n/a
This does not work for me.
Put your controls simply into a panel Control, sets its property AutoScroll to True. OK
The two controls inside the panel, say another pannel holding checkboxes and a treeview should have their properties AutoScroll and Scrollable
respectively set to False. TreeView does not have Autoscroll and if you set scrollable to False it will
not scroll, Checked Listbox does not havve an option to take out the scroll
bars on vertical
Since panel inherits from ScrollableControl class, the two controls inside
will do the same. Therefore, no need for them to have their own scroll
bars.

Nov 20 '05 #15

P: n/a
It works perfectly for me.

TreeView has property Scrollable - set it to False
Panel has property AutoScroll - set it to False, too

Then put them both on another panel whose AutoScroll property is set to
True.

It will work perfectly. The only problem is that the TreeView and Panel
inside the container Panel has to have its size set to exact size you need,
but that is easy, you count number of items inside and multiply by a Height
of an item (e.g. check box in my case).

If any af the two controls inside fall outside of the borders of container
panel, its scroll bar will show automatically and when you scroll that one,
the controls inside will scroll simultaneously as well.

Simple and easy.

Thanks for your help anyways, just wanted to post the solution in the case
you can reuse it.
--
Dino Buljubasic
Software Developer
http://rivusglobal.com

"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:Ou**************@tk2msftngp13.phx.gbl...
This does not work for me.
Put your controls simply into a panel Control, sets its property AutoScroll
to True.

OK
The two controls inside the panel, say another pannel holding checkboxes

and
a treeview should have their properties AutoScroll and Scrollable
respectively set to False.

TreeView does not have Autoscroll and if you set scrollable to False it

will not scroll, Checked Listbox does not havve an option to take out the scroll bars on vertical
Since panel inherits from ScrollableControl class, the two controls inside will do the same. Therefore, no need for them to have their own scroll
bars.


Nov 20 '05 #16

P: n/a
Can u send my your form code so I can see what u did.
"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:KOk8b.116542$kW.11253@edtnps84...
It works perfectly for me.

TreeView has property Scrollable - set it to False
Panel has property AutoScroll - set it to False, too

Then put them both on another panel whose AutoScroll property is set to
True.

It will work perfectly. The only problem is that the TreeView and Panel
inside the container Panel has to have its size set to exact size you need, but that is easy, you count number of items inside and multiply by a Height of an item (e.g. check box in my case).

If any af the two controls inside fall outside of the borders of container
panel, its scroll bar will show automatically and when you scroll that one, the controls inside will scroll simultaneously as well.

Simple and easy.

Thanks for your help anyways, just wanted to post the solution in the case
you can reuse it.
--
Dino Buljubasic
Software Developer
http://rivusglobal.com

"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:Ou**************@tk2msftngp13.phx.gbl...
This does not work for me.
Put your controls simply into a panel Control, sets its property

AutoScroll
to True.

OK
The two controls inside the panel, say another pannel holding checkboxes
and
a treeview should have their properties AutoScroll and Scrollable
respectively set to False.

TreeView does not have Autoscroll and if you set scrollable to False it

will
not scroll, Checked Listbox does not havve an option to take out the

scroll
bars on vertical
Since panel inherits from ScrollableControl class, the two controls inside will do the same. Therefore, no need for them to have their own

scroll bars.



Nov 20 '05 #17

P: n/a
There is no code, just setting properties.

You don't need any code.
"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:u7**************@TK2MSFTNGP09.phx.gbl...
Can u send my your form code so I can see what u did.
"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:KOk8b.116542$kW.11253@edtnps84...
It works perfectly for me.

TreeView has property Scrollable - set it to False
Panel has property AutoScroll - set it to False, too

Then put them both on another panel whose AutoScroll property is set to
True.

It will work perfectly. The only problem is that the TreeView and Panel
inside the container Panel has to have its size set to exact size you

need,
but that is easy, you count number of items inside and multiply by a

Height
of an item (e.g. check box in my case).

If any af the two controls inside fall outside of the borders of container
panel, its scroll bar will show automatically and when you scroll that

one,
the controls inside will scroll simultaneously as well.

Simple and easy.

Thanks for your help anyways, just wanted to post the solution in the case you can reuse it.
--
Dino Buljubasic
Software Developer
http://rivusglobal.com

"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:Ou**************@tk2msftngp13.phx.gbl...
This does not work for me.

> Put your controls simply into a panel Control, sets its property
AutoScroll
> to True.
OK

> The two controls inside the panel, say another pannel holding checkboxes and
> a treeview should have their properties AutoScroll and Scrollable
> respectively set to False.
TreeView does not have Autoscroll and if you set scrollable to False
it will
not scroll, Checked Listbox does not havve an option to take out the

scroll
bars on vertical

> Since panel inherits from ScrollableControl class, the two controls

inside
> will do the same. Therefore, no need for them to have their own

scroll > bars.



Nov 20 '05 #18

This discussion thread is closed

Replies have been disabled for this discussion.