VB.NET表格冻结

时间:2013-12-14 07:00:39

标签: vb.net multithreading makefile invoke

    Public Sub New()

    ' This call is required by the designer.
    InitializeComponent()

    ' Add any initialization after the InitializeComponent() call.
    Dim t As New Threading.Thread(AddressOf Start)
    t.Start()
End Sub
Private Delegate Sub StartDelegate()
Private Sub Start()
    If Me.InvokeRequired = True Then
        Invoke(New StartDelegate(AddressOf Start))
    Else
        For i = 0 To 10000000 Step 1 : Me.Text = i : Next i
    End If
End Sub

当我启动程序时,它会运行并开始计数但是U无法移动表单而且没有交叉线程错误。

提前致谢。

0 个答案:

没有答案