你可以找一下关于控件消息的API函数千,里面有关于滚动消息的API函数。

解决方案 »

  1.   

    VERSION 5.00
    Begin VB.Form Form1 
       Caption         =   "Form1"
       ClientHeight    =   4410
       ClientLeft      =   60
       ClientTop       =   345
       ClientWidth     =   7125
       LinkTopic       =   "Form1"
       ScaleHeight     =   4410
       ScaleWidth      =   7125
       StartUpPosition =   3  'Windows Default
       Begin VB.TextBox Text2 
          Height          =   465
          Left            =   420
          TabIndex        =   2
          Text            =   "Text2oioizdfgkpizdfgkpizdfgkpizdfgkpizdfgkpsdgsdfgopsdfg***"
          Top             =   2040
          Width           =   5940
       End
       Begin VB.CommandButton Command1 
          Caption         =   "Command1"
          Default         =   -1  'True
          Height          =   495
          Left            =   2370
          TabIndex        =   1
          Top             =   2700
          Width           =   1215
       End
       Begin VB.TextBox Text1 
          Height          =   1485
          Left            =   1950
          MultiLine       =   -1  'True
          ScrollBars      =   2  'Vertical
          TabIndex        =   0
          Top             =   300
          Width           =   2145
       End
    End
    Attribute VB_Name = "Form1"
    Attribute VB_GlobalNameSpace = False
    Attribute VB_Creatable = False
    Attribute VB_PredeclaredId = True
    Attribute VB_Exposed = False
    Private Sub Command1_Click()
        Text1.Text = Text1.Text & Text2.Text
        With Text1
            .SelStart = 0
            .SelLength = Len(.Text)
        End With
        Text2.SetFocus
    End Sub
      

  2.   

    http://www.planet-source-code.com/xq/ASP/txtCodeId.2896/lngWId.1/qx/vb/scripts/ShowCode.htm
      

  3.   

    http://www.planet-source-code.com/xq/ASP/txtCodeId.29684/lngWId.1/qx/vb/scripts/ShowCode.htm
      

  4.   

    http://www.planet-source-code.com/xq/ASP/txtCodeId.5205/lngWId.1/qx/vb/scripts/ShowCode.htm
      

  5.   

    '运用windows API函数可以控制文本框翻页功能(文本框的滚动条设置与否并不相关)
    'imgUP,imgDown做为事件触发,当然可以用Timer控件或者Command控件操作
    'rtxtMain为控制滚动的文本框
    'API函数声明及常量声明
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    Private Const SB_LINEUP = 0
    Private Const SB_LINEDOWN = 1
    Private Const WM_VSCROLL = &H115'向上滚动:变量I为一次滚动的行数
    Private Sub imgUP_Click()
    Dim X As Long
    Dim i As Integer
        For i = 0 To 10
        X = SendMessage(rtxtMain.hwnd, WM_VSCROLL, SB_LINEUP, ByVal 0&)
        NextEnd Sub'向下滚动
    Private Sub imgDown_Click()
    Dim X As Long
    Dim i As Integer
        For i = 0 To 10
        X = SendMessage(rtxtMain.hwnd, WM_VSCROLL, SB_LINEDOWN, ByVal 0&)
        Next
    End Sub'以上代码为我在触摸屏软件中的文本滚动控制代码,不知能否满足你的要求。