我是想要能过进度条,然后进入第二个窗体,但是出现了死循环:
        ProgressBar1.Value = i
        Dim frm2 As New Form2
        i = i + 1
        If i = 100 Then            frm2.Show()
        End If
求救!!

解决方案 »

  1.   


       晕,发到VB板块吧!这是VC/MFC的。
      

  2.   

    你这个循环根本没有退出啊load frm2
    frm2.show
    exit sub/function ???
      

  3.   

    你要给出整个 sub/function 代码
      

  4.   

    Public Class Form3
        Inherits System.Windows.Forms.Form
        Dim i As Integer
    Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Timer1.Enabled = True
        End Sub    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            ProgressBar1.Value = i
            Dim frm2 As New Form2
            i = i + 1
            If i = 100 Then            frm2.Show()
            End If
        End Sub
      

  5.   

    If i = 100 Then
        Timer1.Enable = false  // 好久没碰VB了,不知道是不是这么写
                frm2.Show()
            End If 
      

  6.   

    .net都过来了……
    楼上正解。
      

  7.   

    Timer1.Enable = false  ,七楼说的对,加了这条代码就可以了阿