Thanks to Patrick Steele for helping with this one !!!
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
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.PerformVscroll = New System.Windows.Forms.Button
Me.rtb2 = New System.Windows.Forms.RichTextBox
Me.SuspendLayout()
'
'PerformVscroll
'
Me.PerformVscroll.Location = New System.Drawing.Point(112, 40)
Me.PerformVscroll.Name = "PerformVscroll"
Me.PerformVscroll.Size = New System.Drawing.Size(104, 23)
Me.PerformVscroll.TabIndex = 2
Me.PerformVscroll.Text = "PerformVscroll"
'
'rtb2
'
Me.rtb2.Location = New System.Drawing.Point(112, 120)
Me.rtb2.Name = "rtb2"
Me.rtb2.TabIndex = 3
Me.rtb2.Text = "RichTextBox1"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(336, 293)
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 +=
"RichTextBox1jkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkh
kjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhg
jghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghj
gjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkh
khgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgj
khgkjjkhkjhgjghJJJJJkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjh
gjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjghjgjkhkhgjkhgkjjkhkjhgjgh
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)
End Sub
Private Sub handleScroll(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles rtb2.VScroll
Console.WriteLine("Scrolling")
End Sub
End Class
--
Regards - One Handed Man
Author : Fish .NET & Keep .NET
=========================================
This posting is provided "AS IS" with no warranties,
and confers no rights.
news-server.san.rr.com said:
How can I programmatically force a vertical scroll in a richtextbox when I
have the scroll bars hidden from view? The application I am writing is a
kiosk and I have graphical scroll bars instead of the built-ins. Thank you
--
Regards - One Handed Man
Author : Fish .NET & Keep .NET
=========================================
This posting is provided "AS IS" with no warranties,
and confers no rights.