Hello everyone... I have something to ask again.. I develop a program that will send bulk messages but the problem is that when I load at least 1000 emails then I want to stop the application I cannot stop it. Is there any way to stop this application without closing the form? So that i can save the file on my listview? Here is my code upon send bulk emails.
One problem I encountered also is that once the mail started to send and the user will click my listview my application will stop sending and I cannot stop the application anymore so if this happen I end up the application by using the stop in a task manager. Anyone can help me to this? Thanks in advance and have a nice day.Code:Private Sub frmStatus_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown Dim i As Integer Dim holder As String 'Dim itemstring As String Dim LVITem As New ListViewItem Try For i = 0 To ListView1.Items.Count - 1 holder = ListView1.Items(i).SubItems(1).Text sendHTMLmail() ListView1.Items(i).SubItems(2).Text = carrier lblCount.Text = i + 1 lblLvwCount.Text = ListView1.Items.Count SmoothProgressBar2.Value = (i + 1) * 100 / ListView1.Items.Count Label1.Text = ((i + 1) * 100 / ListView1.Items.Count).ToString("N", nfi) + "%" Next btnLog.Visible = True btnStop.Enabled = True Catch ex As Exception MsgBox(ex.Message) End Try End Sub





Reply With Quote