24-07-15, 06:33 PM
سلام
موفقين
كود :
Imports System.Threading
Public Class Form1
Dim m As Integer = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Not BackgroundWorker1.IsBusy Then BackgroundWorker1.RunWorkerAsync()
End Sub
Private Delegate Sub Control()
Private Sub BackgroundWorker1_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
Do
Dim Invoker As New Control(Sub()
TextBox1.Text = m
End Sub)
TextBox1.Invoke(Invoker, Nothing)
m = m + 5
Thread.Sleep(1000)
Loop
End Sub
End Classموفقين
متغيب
