我真的不是高手
不过我有一个笨方法Private Sub Command1_Click()
Label1.AUTOSIZE=TRUE
Label1.Caption = "234234234234234'"  ’给标签赋值
If Label1.Width > 720 Then MsgBox "超过了!!!"   '720就是你自己定义的界限
End Sub

解决方案 »

  1.   

    吸海垂虹:你的办法很有新意,不过怎么实现翻页呢?还有下面的语句这么会出现错误呢?
    我实在是想不明白:
        Dim char1, char2 As String * 1
         Dim fileopen As String
         Dim filesave As String
         fileopen = "C:\Documents and Settings\Administrator\桌面\poem.mdb"
         filesave = "C:\Documents and Settings\Administrator\桌面\poem2.mdb"
         Open fileopen For Binary As #1
         Open filesave For Binary As #2
         
        
         Dim temp1 As Long
         temp1 = FileLen(fileopen)
         For i = 1 To temp1
             Get 1, , char1 ‘错误在这一句
             Put 2, , char1
        Next i
      

  2.   

    songyangk:对头。请问对前面的问题有何见解?
      

  3.   

    使用 PictureBox 或 Form 的 TextWidth 方法! 
      

  4.   

    Private Sub Command1_Click()
    'Objects: Form1、Label1、Picture1、Command1
    Dim iTemp As Integer
    iTemp = Picture1.Font.Size
    Picture1.Font.Size = Label1.Font.Size
    If Picture1.TextWidth(Label1.Caption) > Label1.Width Then
       MsgBox "OverFlow!"
    End If
    Picture1.Font.Size = iTemp
    End Sub
      

  5.   

    以下代碼可以完成你要的標簽滾動功能
    VERSION 5.00
    Begin VB.Form Form1 
       Caption         =   "Form1"
       ClientHeight    =   3195
       ClientLeft      =   60
       ClientTop       =   345
       ClientWidth     =   4680
       LinkTopic       =   "Form1"
       ScaleHeight     =   3195
       ScaleWidth      =   4680
       StartUpPosition =   3  'Windows Default
       Begin VB.Frame Frame1 
          BorderStyle     =   0  'None
          Height          =   420
          Left            =   495
          TabIndex        =   2
          Top             =   135
          Width           =   3705
          Begin VB.Label Label1 
             AutoSize        =   -1  'True
             Caption         =   "Label1"
             Height          =   195
             Left            =   0
             TabIndex        =   3
             Top             =   90
             Width           =   480
          End
       End
       Begin VB.CommandButton Command1 
          Caption         =   "Command1"
          Height          =   555
          Left            =   1080
          TabIndex        =   1
          Top             =   2340
          Width           =   915
       End
       Begin VB.HScrollBar HScroll1 
          Height          =   285
          Left            =   4185
          Min             =   20
          SmallChange     =   10
          TabIndex        =   0
          Top             =   180
          Value           =   20
          Visible         =   0   'False
          Width           =   420
       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()
    Label1.Caption = "3214dfudsa324532543214234234hfjkdsahfnjkdsalhfjkdsalhfjkdsalhfjkdlsahfjdkaslf"If Label1.Width > Frame1.Width Then
        HScroll1.Visible = True
    Else
        HScroll1.Visible = False
    End If
    End SubPrivate Sub HScroll1_Change()
    Label1.Left = -HScroll1.ValueEnd Sub
      

  6.   

    很簡單,用frame1做label1的容器
    label的autosize=true
    寬大於frame1就顯示滾動條反之影常
    用滾動條讓label1在容器內左右移動
      

  7.   

    吸海垂虹:是这样的,我做的是一个多媒体的东西因而界面必须用图片,你的方法很好,但
    是framel作标签的容器的话,则会露出灰白色的框架底纹。而我需要的效果是标签是透明的。请问有什么更好的方法吗?
      

  8.   

    为什么不用 TextBox???!!!
    自带横向 HSrollBar,Lock =True