把text放到一个picture,在picture旁边放一个滚动条控件,拖动滚动条时,在事件中写代码移动pic即可。

解决方案 »

  1.   

    AGREE,你真行,居然比我还快!!
      

  2.   

    没看到吗?它发帖前我就回复了。
    csdn的帖子发表时间比回复时间还晚,真够夸张的。
      

  3.   

    试一下下面这个程序
    form1.frm
    VERSION 5.00
    Begin VB.Form Form1 
       Caption         =    "This Form is larger than the screen can show"
       ClientHeight    =   5940
       ClientLeft      =   1935
       ClientTop       =   2085
       ClientWidth     =   6735
       LinkTopic       =   "Form1"
       PaletteMode     =   1  'UseZOrder
       ScaleHeight     =   5940
       ScaleWidth      =   6735
       Begin VB.HScrollBar HScroll 
          Height           =   300
          LargeChange     =   900
          Left             =   -60
          SmallChange     =   30
          TabIndex        =    2
          Top              =    5370
          Width            =   6435
       End
       Begin VB.VScrollBar VScroll 
          Height           =   5625
          LargeChange     =   900
          Left             =   5550
          SmallChange     =   30
          TabIndex        =    1
          Top              =   0
          Width            =   300
       End
       Begin VB.PictureBox PicBox 
          BackColor       =    &H00FFFFFF&
          Height           =   15900
          Left             =   -2820
          ScaleHeight     =   15840
          ScaleWidth      =    11580
          TabIndex        =    0
          Top              =    -4170
          Width            =   11640
          Begin VB.TextBox Text1 
             Height           =   2535
             Left             =   3030
             MultiLine        =   -1  'True
             ScrollBars       =   2  'Vertical
             TabIndex         =   10
             Top              =    3870
             Width            =   3705
          End
          Begin VB.ListBox List1 
             Height           =   3480
             Left             =   7830
             TabIndex         =   7
             Top              =   600
             Width            =   3105
          End
          Begin VB.CommandButton Command1 
             Caption          =   "End This Program"
             Height           =   465
             Left             =   1980
             TabIndex         =   6
             Top              =   540
             Width            =   2445
          End
          Begin VB.Label Label1 
             Alignment        =   2  'Center
             BackStyle        =   0  'Transparent
             Caption          =   "Gee, I just love little graphics on forms, don't you?"
             BeginProperty Font 
                Name             =    "Arial"
                Size             =   14.25
                Charset          =   0
                Weight           =   700
                Underline        =   0   'False
                Italic           =   -1  'True
                Strikethrough    =   0   'False
             EndProperty
             Height           =   1035
             Index            =   3
             Left             =   4890
             TabIndex         =   9
             Top              =    12870
             Width            =   3135
          End
          Begin VB.Shape Shape2 
             BackColor        =   &H000000FF&
             BorderColor     =    &H0000FFFF&
             BorderStyle     =    4  'Dash-Dot
             BorderWidth     =    3
             FillColor        =   &H000000FF&
             FillStyle        =   0  'Solid
             Height           =   1815
             Index            =   1
             Left             =   8040
             Shape            =   3  'Circle
             Top              =    12810
             Width            =   2565
          End
          Begin VB.Shape Shape2 
             FillColor        =   &H00FF0000&
             FillStyle        =   2  'Horizontal Line
             Height           =   1815
             Index            =   0
             Left             =   1950
             Shape            =   2  'Oval
             Top              =    13320
             Width            =   2565
          End
          Begin VB.Shape Shape1 
             Height           =   2115
             Left             =   2640
             Shape            =   4   'Rounded Rectangle
             Top              =    7800
             Width            =   4995
          End
          Begin VB.Label Label1 
             BackStyle        =   0  'Transparent
             BeginProperty Font 
                Name             =    "Arial"
                Size             =   9.75
                Charset          =   0
                Weight           =   400
                Underline        =   0   'False
                Italic           =   0   'False
                Strikethrough    =   0   'False
             EndProperty
             Height           =   1365
             Index            =   2
             Left             =   3030
             TabIndex         =   8
             Top              =    8340
             Width            =   3135
          End
          Begin VB.Line Line3 
             X1               =    6480
             X2               =    6630
             Y1               =    9060
             Y2               =    8850
          End
          Begin VB.Line Line2 
             X1               =    6450
             X2               =    6630
             Y1               =    8670
             Y2               =    8850
          End
          Begin VB.Line Line1 
             X1               =    6240
             X2               =    6660
             Y1               =    8850
             Y2               =    8850
          End
          Begin VB.Label Label1 
             BackStyle        =   0  'Transparent
             BorderStyle     =    1  'Fixed Single
             Caption          =   "These controls have been placed on this picture box at design time, but can also be added at run-time too."
             BeginProperty Font 
                Name             =    "Arial"
                Size             =   12
                Charset          =   0
                Weight           =   700
                Underline        =   0   'False
                Italic           =   -1  'True
                Strikethrough    =   0   'False
             EndProperty
             Height           =   2205
             Index            =   1
             Left             =   630
             TabIndex         =   5
             Top              =    2310
             Width            =   1815
          End
          Begin VB.Label Label1 
             BackStyle        =   0  'Transparent
             Caption          =   "This is a ""Virtual Form"""
             BeginProperty Font 
                Name             =    "Arial"
                Size             =   12
                Charset          =   0
                Weight           =   700
                Underline        =   0   'False
                Italic           =   -1  'True
                Strikethrough    =   0   'False
             EndProperty
             Height           =   315
             Index            =   0
             Left             =   360
             TabIndex         =   4
             Top              =    1350
             Width            =   2865
          End
          Begin VB.Label lblFiller 
             Height           =   300
             Left             =   6870
             TabIndex         =   3
             Top              =    8670
             Width            =   300
          End
       End
       Begin VB.Menu mnuFileMenu 
          Caption         =    "&File"
       End
    End
      

  4.   

    'Continue
    Attribute VB_Name = "Form1"
    Attribute VB_GlobalNameSpace = False
    Attribute VB_Creatable = False
    Attribute VB_PredeclaredId = True
    Attribute VB_Exposed = False
    Option ExplicitSub AlignScrollBars()
        ' Resize the scrollbars
        HScroll.Width = Me.ScaleWidth - lblFiller.Width
        VScroll.Height = Me.ScaleHeight - lblFiller.Height
        
        ' Reposition the scrollbars
        HScroll.Left = 0: HScroll.Top = Me.ScaleHeight - HScroll.Height
        VScroll.Top = 0: VScroll.Left = Me.ScaleWidth - VScroll.Width
        
        ' Redimension the scrollbar parameters
        HScroll.Max = PicBox.Width - Me.ScaleWidth
        VScroll.Max = PicBox.Height - Me.ScaleHeight
        
        ' Reposition the PictureBox
        PicBox.Top = (-1 * VScroll)
        PicBox.Left = (-1 * HScroll)
            
        ' Reposition the Picturebox label by scrollbars
        lblFiller.Top = VScroll.Height + VScroll - 30
        lblFiller.Left = HScroll.Width + HScroll - 30
        
        UpdateDisplay
    End SubSub UpdateDisplay()
        ' Place text on the PictureBox
        PicBox.AutoRedraw = True
        Dim PictureBoxText As String
        PictureBoxText = "Virtual Form - 8? x 11 size"
        With PicBox
            .Font = "Arial"
            .FontSize = 14
            .FontBold = True
            .FontItalic = True
            .CurrentX = (PicBox.Width - PicBox.TextWidth(PictureBoxText)) / 2
            .CurrentY = 0
        End With
        PicBox.Print PictureBoxText
        ' Graphics can be drawn on the virtual form at run time
        PicBox.Line (100, 100)-(500, 500), , B
    End SubPrivate Sub Command1_Click()
        End
    End SubPrivate Sub Form_Resize()
        AlignScrollBars
    End SubPrivate Sub HScroll_Change()
        AlignScrollBars
    End SubPrivate Sub VScroll_Change()
        AlignScrollBars
    End Sub
      

  5.   

    好象要用两个picturebox吧,一个放在另一个里面,text再放到里面的picturebox上
      

  6.   

    我的 确定 取消按钮 可是不能滚动的。
    这样是不是需要两个 picture,把其中一个和滚动条放到 另一个picture里面
    就行了。
    算了,我也别太赖了,自己试试吧