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 17 2060
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
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
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
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 > > >
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 > > > > > > > >
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 > > > > > > > >
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 > > > > > > > > > > > > > > >
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 > > > > > > > > > > > > > > >
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 > > > > > > > > > > > > > > > > > > > > > > > >
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 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
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 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
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 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
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 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
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.
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.
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.
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.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Konrad Koller |
last post by:
For a card playing game I constructed a layout of 49 playing cards
(size of each: x=71, y=96) which are arranged in a 7X7 matrix side by
side. Accordingly the pysical size of the Canvas is x=71*7,...
|
by: adrien |
last post by:
Hi,
(also posted in netscape.public.mozilla.browser)
i use netscape 7 and want to hide the scrollbars of the window when
something happens. I tried this:
window.scrollbars.visible=false...
|
by: Nobody |
last post by:
Okay, you are all so smart in here. Answer me this:
IE6 in standards mode doesn't seem to hide scrollbars on the body element
(overflow:hide) Ain't this a quandary. I have it in my head that I...
|
by: Dennis M. Marks |
last post by:
My script opens a window that is supposed to be resizable and
scrollable. I am on a Mac. With IE 5.1.7 it works fine. With Netscape 6
there is no scroll bar. I am able to resize it smaller than the...
|
by: Jorg Matter |
last post by:
Hello
I should like to define the colors of the scrollbars for divs with overflows
set to auto. I have a design with black background and white text. Now the
scrollbars do not look very nice and...
|
by: Andi Plotsky |
last post by:
I have a subform where I dynamically change the SourceObject dependent upon
the User's response to questions on the Main form.
My problem is that the scrollbars do not show up on either the Main...
|
by: Fabrício de Novaes Kucinskis |
last post by:
Hi all,
I have to problems concerning datagrids, tabcontrols and scrollbars:
1) I created a form with a TabControl. This TabControl has two TabPages: the
first with a datagrid to browse...
|
by: GTi |
last post by:
I have a popup window, If this window is to smaal the scrollbars is
visible.
Is there any JavaScript available so I can check if the scrollbars is
visible on page (right and bottom side)?
Then I...
|
by: needin4mation |
last post by:
Does anyone know what would cause a popup with scrollbars=1 to suddenly
lose its scrollbars? I have a popup from window.open
(....scrollbars=1..) and it used to be a normal window that would have...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
| |