我想让一个label控件位于一个picturebox容器控件的上方做一个带指示的进度条,但无论如何也做不到(用format>order>bring to front菜单没有作用).想把label的位置定在frame的上方似乎也不可能,请问这该怎么办?

解决方案 »

  1.   

    我好象听不懂你在说什么?
    你是不是要把label分别放在那两个控件上?
      

  2.   

    Picturebox和Frame都是容器类控件,我想让label显示在它们的上方,就只有把label控件拖到它们的里面。
      

  3.   

    TextBox模拟
    Private Sub Form_Load()
        With Text1
            .Appearance = 0
            .BackColor = Picture1.BackColor
            .BorderStyle = 0
            Set .Container = Picture1
            .Enabled = False
            .Text = "lxcc"
            .Top = 0
            .Left = 0
        End With
    End Sub
      

  4.   

    我的进度条模型是这样的:
    -------------------------------------------------------------
    |[picProgress]             [lblStatus]                      |
    -------------------------------------------------------------
    picProgress和lblStatus包含在picBackground中
    picBackground的颜色为白色,作底色用
    picProgress的颜色为蓝色,显示进度
    lblStatus显示一些说明文字问题就是当picProgress到达lblStatus的位置后肯定会把它覆盖掉了.附代码:Private Sub SetProgress(ByVal numProgress, Optional ByVal strProgress As String)
        picProgress.Width = picProgressBackground.Width * numProgress '显示进度条
        
        '显示文本
        If strProgress <> "" Then
            lblStatus.Visible = True
            lblStatus.Caption = strProgress
        Else
            lblStatus.Visible = False
        End If
    End Sub
      

  5.   

    用一个picturebox,一个image,一个Timer空件,
    将image放到picturebox中,并加载一个红色条形图片,将
    Timer的interval=50Private Sub Timer1_Timer()
        If Image1.Left > -Image1.Width Then
            Image1.Left = Image1.Left - 20
        Else:
            MsgBox "时间到"
            Unload Me
        End If
    End Sub
      

  6.   

    用label、picture1、progeressbar做进度条
    Private Sub Form_Load()
         Label1.AutoSize = True
         Label1.Alignment = vbCenter
         Label1.Caption = ""
         Label1.AutoSize = False
         Label1.Width = 0
         Label1.FontBold = True
         Label1.BackColor = vbRed
         Label1.ForeColor = vbWhite
         Picture1.ForeColor = vbWhite
         Picture1.FontBold = True
         Picture1.AutoRedraw = True
         ProgressBar1.Min = 0
         ProgressBar1.Max = 20
    End SubPrivate Sub Command1_Click()
         Dim i As Long, j As Long
         For i = 1 To 20
              For j = 1 To 100000
              DoEvents
              Next
              Call Progress(i * 5)
              ProgressBar1.Value = i
              Call Progress2(i * 5, Picture1.Width)
         Next
    End SubPrivate Sub Progress(percent As Long)
         'percent代表目前的百分比
         Dim msg As String
         msg = percent & "%"
         With Picture1
              .Cls
              Picture1.Line (0, 0)-(percent / 100 * .ScaleWidth, .ScaleHeight), vbBlue, BF
              .CurrentX = (.ScaleWidth - .TextWidth(msg)) / 2
              .CurrentY = (.ScaleHeight - .TextHeight(msg)) / 2
              Picture1.Print msg
              .Refresh
         End With
    End SubPrivate Sub Progress2(percent As Long, final As Long)
         'percent代表目前的百分比 , final 代表100%時Label的寬度
         Label1.Caption = percent & "%"
         Label1.Move Label1.Left, Label1.Top, percent / 100 * final
    End Sub