20-04-14, 06:37 PM
كود :
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Control.CheckForIllegalCrossThreadCalls = False
BackgroundWorker1.RunWorkerAsync()
End Sub
Private Sub BackgroundWorker1_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
If ListBox1.SelectedIndex < ListBox1.Items.Count - 1 Then
TextBox1.Text = ListBox1.SelectedItem.ToString
Dim myclass As New vt
myclass.GetData(TextBox1.Text)
Else
ListBox1.SelectedIndex = -1
End If
End Sub
End Class
