要放进去是不行的,但可以画在一起,调整它们的高宽为一致,并把进度条的边线风格设为平面,看起来就象真的了。你可以试一试。

解决方案 »

  1.   

    竹子真是历害,看来要多向竹子学习了,不过这样好难看呀
      

  2.   

    我也想知道这个问题,相信应该是可以的,因为我看到很多软件都是这样的,比如说IE5,怎么做呢?
      

  3.   

    把这个放到模块中:
    Option ExplicitPublic Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
    Public Declare Function SendMessageAny Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal msg As Long, ByVal wParam As Long, lParam As Any) As LongPublic Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
    End TypeMessages
    '
    Public Const WM_USER As Long = &H400
    Public Const SB_GETRECT As Long = (WM_USER + 10)把这个放在form1中。
    Option Explicit
    'Private Sub Command1_Click()
        Command1.Enabled = False    ProgressBar1.Min = 0
        ProgressBar1.Max = 100    ShowProgressInStatusBar True    Timer1.Enabled = True
    End SubPrivate Sub ShowProgressInStatusBar(ByVal bShowProgressBar As Boolean)    Dim tRC As RECT
        
        If bShowProgressBar Then        SendMessageAny StatusBar1.hwnd, SB_GETRECT, 0, tRC        With tRC
                .Top = (.Top * Screen.TwipsPerPixelY)
                .Left = (.Left * Screen.TwipsPerPixelX)
                .Bottom = (.Bottom * Screen.TwipsPerPixelY) - .Top
                .Right = (.Right * Screen.TwipsPerPixelX) - .Left
            End With        With ProgressBar1
                SetParent .hwnd, StatusBar1.hwnd
                .Move tRC.Left, tRC.Top, tRC.Right, tRC.Bottom
                .Visible = True
                .Value = 0
            End With
            
        Else        SetParent ProgressBar1.hwnd, Me.hwnd
            ProgressBar1.Visible = False
        End If
        
    End SubPrivate Sub Form_Unload(Cancel As Integer)    ShowProgressInStatusBar False
        
    End SubPrivate Sub Timer1_Timer()
        Static lCount As Long
        
        lCount = lCount + 5
        
        If lCount > 100 Then
            Timer1.Enabled = False
            ShowProgressInStatusBar False
            Command1.Enabled = True
            lCount = 0
        End If
        
        ProgressBar1.Value = lCount
        
    End Sub
      

  4.   

    如果想让进度条连续(没有缝隙)怎么办?