473,396 Members | 2,151 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to use Progress Bar while processing an application.

Expand|Select|Wrap|Line Numbers
  1. Private Sub IDfield_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles IDfield.KeyPress
  2.  
  3.         If Asc(e.KeyChar) = Keys.Enter Then
  4.             If IDfield.Text = Nothing Then
  5.                 MsgBox("Dont forget to enter the Operator ID")
  6.             ElseIf IDfield.Text.Length < 4 Then
  7.                 MsgBox("Operator ID must have 4 to 8 characters")
  8.             Else
  9.  
  10.                 Dim samplefrmt As Integer = 0
  11.                 BatSizenew = Form1.BatSize.Text
  12.                 BatSizenew = CInt(Int(Form1.BatSize.Text))
  13.  
  14.                 For ya As Integer = 0 To Form1.SelBat.Items.Count - 1
  15.                     Timer1.Start()
  16.                     Timer1.Stop()
  17.                     rec1 = 1
  18.  
  19.                     Dim imgCount As Integer = Val(Form1.SelBat.Items(ya).SubItems(1).Text)
  20.                     Dim batSz As Integer = Val(Form1.BatSize.Text)
  21.  
  22.                     Dim dbCount As Integer = CInt(Math.Ceiling(imgCount / batSz))
  23.  
  24.                     Dim batchFolderName As String = Form1.SelBat.Items(ya).SubItems(0).Text
  25.  
  26.                     Dim batchFolderDirectory As String = Form1.Dir_folder.Text & "\DDC OS" & "\CARD DECK" & "\" & DateTime.Now.ToString("yyyyMMdd") & "\" & batchFolderName
  27.                     Dim testPath1 As String = batchFolderDirectory & "\Compare"
  28.                     Dim testPath5 As String = batchFolderDirectory & "\Entry1"
  29.                     Dim testPath2 As String = batchFolderDirectory & "\Entry2"
  30.                     Dim testPath3 As String = batchFolderDirectory & "\Images"
  31.                     Dim testPath4 As String = Form1.Dir_folder.Text & "\CBATCH"
  32.                     Dim testPath6 As String = Form1.Dir_folder.Text & "\CBATCH" & "\CardDeck" & "\" & DateTime.Now.ToString("yyyyMMdd")
  33.                     Dim ncbpth As String = testPath6 & "\" & Form1.SelBat.Items(ya).SubItems(0).Text & ".mdb"
  34.                     Dim ncbtext As String = testPath6 & "\" & Form1.SelBat.Items(ya).SubItems(0).Text & ".txt"
  35.  
  36.                     If Directory.Exists(batchFolderDirectory) Then
  37.                         Dim ans As DialogResult = MessageBox.Show("Already contains a folder name", "Do you want to Overwrite?", MessageBoxButtons.YesNoCancel)
  38.                         If ans = Windows.Forms.DialogResult.Yes Then
  39.                             Try
  40.                                 Timer1.Start()
  41. aldrin:                         Directory.Delete(batchFolderDirectory, True)
  42.                             Catch ex As Exception
  43.                                 MsgBox(ex.Message, MsgBoxStyle.Critical)
  44.                                 Application.Exit()
  45.  
  46.                             End Try
  47.                             IO.File.Delete(ncbpth)
  48.                             IO.File.Delete(ncbtext)
  49.  
  50.                         ElseIf ans = Windows.Forms.DialogResult.No Then
  51.                             'Timer1.Stop()
  52.                             'Form1.ProgressBar1.Value = 0
  53.                             Continue For
  54.                         Else
  55.                             'Timer1.Stop()
  56.                             'Form1.ProgressBar1.Value = 0
  57.                             Exit For
  58.                         End If
  59.                     End If
  60.  
  61.                     If Not IO.Directory.Exists(testPath5) Then
  62.                         MkDir(testPath5)
  63.                     End If
  64.                     If Not IO.Directory.Exists(testPath1) Then
  65.                         MkDir(testPath1)
  66.                     End If
  67.                     If Not IO.Directory.Exists(testPath2) Then
  68.                         MkDir(testPath2)
  69.                     End If
  70.                     If Not IO.Directory.Exists(testPath3) Then
  71.                         MkDir(testPath3)
  72.                     End If
  73.                     If Not IO.Directory.Exists(testPath4) Then
  74.                         MkDir(testPath4)
  75.                     End If
  76.                     If Not IO.Directory.Exists(testPath6) Then
  77.                         MkDir(testPath6)
  78.                     End If
  79.  
  80.                     dir = testPath1
  81.  
  82.                     Dim cbatpath As String = Form1.SelBat.Items(ya).SubItems(0).Text
  83.                     Dim file As System.IO.StreamWriter
  84.                     Dim s As String
  85.                     Dim u As String
  86.                     s = Form1.SelBat.Items(ya).SubItems(2).Text & "\" & Form1.SelBat.Items(ya).SubItems(0).Text
  87.                     u = IDfield.Text
  88.  
  89.                     file = My.Computer.FileSystem.OpenTextFileWriter(testPath6 & "\" & cbatpath & ".txt", False)
  90.                     file.WriteLine("Client name         :       DDC OS")
  91.                     file.WriteLine("Job name            :       CARD DECK")
  92.                     file.WriteLine("Programmer name     :       Jeramiel Ortega")
  93.                     file.WriteLine("Project Coordinator :       Marites Santos")
  94.                     file.WriteLine("Date                :       " & Format(Now, "f"))
  95.                     file.WriteLine("Shipment/Zipfile    :       " & s)
  96.                     file.WriteLine("Batch by(OperID)    :       " & u)
  97.                     file.WriteLine("Directory Compare   :       " & testPath1)
  98.                     file.WriteLine("Directory Entry1    :       " & testPath5)
  99.                     file.WriteLine("Directory Entry2    :       " & testPath2)
  100.                     file.WriteLine("Directory Images    :       " & testPath3)
  101.                     file.WriteLine("Date Received       :       _____________________________")
  102.                     file.WriteLine("Output Date         :       _____________________________")
  103.                     file.WriteLine("DE Target           :       _____________________________")
  104.                     file.WriteLine("QC Target           :       _____________________________")
  105.                     file.WriteLine("Val Target          :       _____________________________")
  106.                     file.WriteLine("")
  107.                     file.WriteLine(String.Format("{0,0} {1,23} {2,15} {3,15}", "MDB Names", "Start Record", "End Record", "BatchCount"))
  108.  
  109.                     catNewDB.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" + testPath6 + "\" & cbatpath & ".mdb")
  110.                     '***********************CBATCH TABLE**********************************
  111.                     conctn = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
  112.                                       "  Data Source=" + testPath6 + "\" & cbatpath & ".mdb")
  113.  
  114.                     Dim cmnd As New OleDb.OleDbCommand("CREATE TABLE CardDeck( " & _
  115.                        "RecNum int identity," & "ZipFile NVarchar(50)," & "DvdName NVarchar(50)," & "BatchNo NVarchar(50)," & "OImage001 NVarchar(50)," & _
  116.                     "Image001 NVarchar(50)," & "CONSTRAINT [pk_RecNum] PRIMARY KEY (RecNum)) ", conctn)
  117.                     conctn.Open()
  118.                     cmnd.ExecuteNonQuery()
  119.                     'conctn.Close()
  120.                     '******************************ENDS HERE!! ****************************
  121.  
  122.                     '************DB PER BATSIZE*************
  123.                     Dim imageNum As Integer = 0
  124.                     Dim ss As Integer = 0
  125.                     '2ND LOOP HERE
  126.                     For i As Integer = 0 To dbCount - 1
  127.  
  128.                         catNewDB.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" + dir + "\" & Format(i + 1, "00000000") & ".mdb")
  129.  
  130.                         conn = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
  131.                       "  Data Source=" + dir + "\" & Format(i + 1, "00000000") & ".mdb")
  132.                         Dim cmd As New OleDb.OleDbCommand("CREATE TABLE Data001( " & _
  133.                            "RecNum int identity," & "PullOut int," & "Title NVarchar(50)," & "Firstname NVarchar(50)," & "Surname NVarchar(50)," & _
  134.                         "Address1 NVarchar(50)," & "Address2 NVarchar(50)," & "Address3 NVarchar(50)," & "County NVarchar(50)," & "Postcode text," & _
  135.                         "QaskFlag NVarchar(50)," & "Telephone number," & "Mobile number," & "Email NVarchar(50)," & "DOB NVarchar(50)," & "Field001 NVarchar(50)," & _
  136.                         "Field002 NVarchar(50)," & "Field003 NVarchar(50)," & "Field004 NVarchar(50)," & "Field005 NVarchar(50)," & "CONSTRAINT [pk_RecNum] PRIMARY KEY (RecNum)) ", conn)
  137.                         conn.Open()
  138.                         cmd.ExecuteNonQuery()
  139.  
  140.                         Dim cmd1 As New OleDb.OleDbCommand("CREATE TABLE CardDeck ( " & _
  141.                      "RecNum int identity," & "ZipFile NVarchar(50)," & "DvdName NVarchar(50)," & "BatchNo NVarchar(50)," & "PullOut int," & _
  142.                       "RefInd int," & "KeyFlag NVarchar(50)," & "KeyId NVarchar(50)," & "KeyDate NVarchar(50)," & "VerFlag NVarchar(50)," & "VerID NVarchar(50)," & _
  143.                     "VerDate int," & "ComFlag int," & "ComID NVarchar(50)," & "ComDate NVarchar(50)," & "UpdFlag NVarchar(50)," & "UpdID NVarchar(50)," & _
  144.                     "UpdDate NVarchar(50)," & "QCFlag NVarchar(50)," & "QCID NVarchar(50)," & "QCDate NVarchar(50)," & "QASFlag NVarchar(50)," & _
  145.                     "QASID NVarchar(50)," & "QASDate NVarchar(50)," & "ValFlag NVarchar(50)," & "ValID NVarchar(50)," & "ValDate NVarchar(50)," & _
  146.                     "RefFlag NVarchar(50)," & "RefID NVarchar(50)," & "RefDate NVarchar(50)," & "Accuracy1 NVarchar(50)," & "Accuracy2 NVarchar(50)," & _
  147.                     "Accuracy3 NVarchar(50)," & "Accuracy4 NVarchar(50)," & "Accuracy5 NVarchar(50)," & "KSCount NVarchar(50)," & "QCID1 NVarchar(50)," & _
  148.                    "QCID2 NVarchar(50)," & "QCID3 NVarchar(50)," & "QCID4 NVarchar(50)," & "QCID5 NVarchar(50)," & "LKFlag1 NVarchar(50)," & _
  149.                     "LKFlag2 NVarchar(50)," & "LKFlag3 NVarchar(50)," & "LKFlag4 NVarchar(50)," & "LKFlag5 NVarchar(50)," & "LocId1 NVarchar(50)," & _
  150.                     "LocId2 NVarchar(50)," & "OImage001 NVarchar(250)," & "Image001 Varchar(150)," & "CONSTRAINT [pk_RecNum] PRIMARY KEY (RecNum)) ", conn)
  151.                         cmd1.ExecuteNonQuery()
  152.  
  153.                         dir2 = Form1.Dir_folder.Text + "\CBATCH"
  154.                         Dim ost As String
  155.                         Dim dbinsert As String = "00000000.##"
  156.                         samplefrmt = samplefrmt + 1
  157.                         ost = samplefrmt.ToString(dbinsert) & ".mdb"
  158.  
  159.                         Form1.FileListBox1.Path = Form1.SelBat.Items(ya).SubItems(2).Text & "\" & Form1.SelBat.Items(ya).SubItems(0).Text
  160.  
  161.                         Dim src As String
  162.                         Dim bS As String = Form1.SelBat.Items(ya).SubItems(2).Text & "\" & Form1.SelBat.Items(ya).SubItems(0).Text
  163.                         Dim dest As String
  164.  
  165.                         Form1.FileListBox1.Path = Form1.SelBat.Items(ya).SubItems(2).Text & "\" & Form1.SelBat.Items(ya).SubItems(0).Text
  166.  
  167.                         Dim imgFrmt As String = "00000000.##"
  168.  
  169.                         Dim flcount As Integer = Form1.FileListBox1.Items.Count
  170.                         Dim pieces As Integer = 0
  171.  
  172.                         Dim ssfrmt As String = ""
  173.                         '3rd loop
  174.                         For n As Integer = imageNum To flcount - 1
  175.                             pieces = pieces + 1
  176.  
  177.                             Dim op As String = Form1.Dir_folder.Text & "\DDC OS" & "\CARD DECK" & "\" & DateTime.Now.ToString("yyyyMMdd") & "\" & batchFolderName & "\Images"
  178.                             ss = ss + 0
  179.                             Dim sam As String
  180.                             imageNum = imageNum + 1
  181.                             src = bS + "\" + Form1.FileListBox1.Items(n).ToString
  182.                             dest = op + "\" + imageNum.ToString(imgFrmt) & ".tif"
  183.                             System.IO.File.Copy(src, dest, True)
  184.  
  185.                             k = imageNum.ToString(imgFrmt) & ".tif"
  186.                             f = Form1.FileListBox1.Items(n).ToString
  187.                             d = Form1.SelBat.Items(ya).SubItems(0).Text
  188.                             Dim filePath As String = Form1.SelBat.Items(ya).SubItems(2).Text
  189.                             Dim directory As String = Path.GetDirectoryName(filePath)
  190.                             Dim split As String() = filePath.Split("\")
  191.                             Dim parentFolder As String = split(split.Length - 1)
  192.                             c = parentFolder
  193.  
  194.                             Dim cmdB1 As String = "INSERT INTO [CardDeck] ([ZipFile],[DvdName],[BatchNo],[RefId],[VerFlag],[ComFlag],[UpdFlag],[QCFlag],[QASFlag],[ValFlag],[RefFlag],[LKFlag1],[LKFlag2],[LKFlag3],[LKFlag4],[LKFlag5],[OImage001],[Image001]) VALUES (@ZipFile, @DvdName, @BatchNo, @RefId, @VerFlag, @ComFlag, @UpdFlag, @QCFlag, @QASFlag, @ValFlag, @RefFlag, @LKFlag1, @LKFlag2, @LKFlag3, @LKFlag4, @LKFlag5, @OImage001, @Image001);"
  195.                             Dim cmdG1 As New OleDb.OleDbCommand(cmdB1, conn)
  196.                             cmdG1.Parameters.AddWithValue("@ZipFile", d)
  197.                             cmdG1.Parameters.AddWithValue("@DvdName", c)
  198.                             cmdG1.Parameters.AddWithValue("@BatchNo", "0000001")
  199.                             cmdG1.Parameters.AddWithValue("@ReFId", "0")
  200.                             cmdG1.Parameters.AddWithValue("@VerFlag", "0")
  201.                             cmdG1.Parameters.AddWithValue("@ComFlag", "0")
  202.                             cmdG1.Parameters.AddWithValue("@UpdFlag", "0")
  203.                             cmdG1.Parameters.AddWithValue("@QCFlag", "0")
  204.                             cmdG1.Parameters.AddWithValue("@QASFlag", "0")
  205.                             cmdG1.Parameters.AddWithValue("@ValFlag", "0")
  206.                             cmdG1.Parameters.AddWithValue("@RefFlag", "0")
  207.                             cmdG1.Parameters.AddWithValue("@LKFlag1", "0")
  208.                             cmdG1.Parameters.AddWithValue("@LKFlag2", "0")
  209.                             cmdG1.Parameters.AddWithValue("@LKFlag3", "0")
  210.                             cmdG1.Parameters.AddWithValue("@LKFlag4", "0")
  211.                             cmdG1.Parameters.AddWithValue("@LKFlag5", "0")
  212.                             cmdG1.Parameters.AddWithValue("@OImage001", f)
  213.                             cmdG1.Parameters.AddWithValue("@Image001", k)
  214.  
  215.                             cmdG1.ExecuteNonQuery()
  216.                             sam = ss.ToString(ssfrmt)
  217.  
  218.                             Dim cmdB As String = ("INSERT INTO [Data001] ([PullOut],[QaskFlag],[Field001],[Field002],[Field003],[Field004],[Field005]) VALUES (@PullOut,@QaskFlag,@Field001,@Field002,@Field003,@Field004,@Field005)")
  219.                             Dim cmdG As New OleDb.OleDbCommand(cmdB, conn)
  220.                             cmdG.Parameters.AddWithValue("@PullOut", "0")
  221.                             cmdG.Parameters.AddWithValue("@QaskFlag", "0")
  222.                             cmdG.Parameters.AddWithValue("@Field001", "0")
  223.                             cmdG.Parameters.AddWithValue("@Field002", "0")
  224.                             cmdG.Parameters.AddWithValue("@Field003", "0")
  225.                             cmdG.Parameters.AddWithValue("@Field004", "0")
  226.                             cmdG.Parameters.AddWithValue("@Field005", sam)
  227.                             cmdG.ExecuteNonQuery()
  228.  
  229.                             '**********************CBATCH INSERT FIELDS VALUE*******************
  230.                             Dim cmdB3 As String = "INSERT INTO [CardDeck] ([ZipFile],[DvdName],[BatchNo],[OImage001],[Image001]) VALUES (@ZipFile, @DvdName, @BatchNo, @OImage001, @Image001);"
  231.                             Dim cmdG3 As New OleDb.OleDbCommand(cmdB3, conctn)
  232.                             cmdG3.Parameters.AddWithValue("@ZipFile", d)
  233.                             cmdG3.Parameters.AddWithValue("@DvdName", c)
  234.                             cmdG3.Parameters.AddWithValue("@BatchNo", "00000001")
  235.                             cmdG3.Parameters.AddWithValue("@OImage001", f)
  236.                             cmdG3.Parameters.AddWithValue("@Image001", k)
  237.                             cmdG3.ExecuteNonQuery()
  238.  
  239.                             '****************************ENDS HERE!!!****************************
  240.                             rec2 += 1
  241.  
  242.                             If pieces = batSz Then
  243.                                 Exit For
  244.                             End If
  245.                             Timer1.Start()
  246.                         Next n
  247.                         bS = Form1.SelBat.Items(ya).SubItems(2).Text & "\" & Form1.SelBat.Items(0).SubItems(0).Text
  248.  
  249.                         Dim tt As String = testPath1
  250.  
  251.                         CType(catNewDB.ActiveConnection, ADODB.Connection).Close()
  252.  
  253.                         My.Computer.FileSystem.CopyDirectory(tt, testPath5, True)
  254.                         My.Computer.FileSystem.CopyDirectory(tt, testPath2, True)
  255.  
  256.  
  257.                         '**CBATCH LOG about databases created****************
  258.                         file.WriteLine(String.Format("{0,5} {1,15} {2,15} {3,15}", Format(i + 1, "00000000") & ".mdb", rec1.ToString, rec2.ToString, batSz))
  259.                         rec1 = rec2 + 1
  260.                         rec2 = rec2
  261.  
  262.                         conn.Close()
  263.                         GC.Collect()
  264.                         GC.WaitForPendingFinalizers()
  265.  
  266.                         conn.Open()
  267.                         conn.Close()
  268.                         GC.Collect()
  269.                         GC.WaitForPendingFinalizers()
  270.  
  271.                         Application.DoEvents()
  272.                     Next
  273.                     file.Close()
  274.                     rec2 = 0
  275.                     Application.DoEvents()
  276.                 Next
  277.  
  278.                 Me.Close()
  279.                 ' Timer1.Start()
  280.             End If
  281.  
  282.             Dim newpath As String = Form1.Dir_folder.Text & "\CBATCH"
  283.             If Not IO.Directory.Exists(newpath) Then
  284.                 MkDir(newpath)
  285.             End If
  286.  
  287.             conns = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" + newpath + "\CardDeck.mdb")
  288.  
  289.             If Not File.Exists(newpath + "\CardDeck.mdb") Then
  290.                 catNewDB.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" + newpath + "\CardDeck.mdb")
  291.                 Dim cmdd As New OleDb.OleDbCommand("CREATE TABLE CardDeck( " & _
  292.                    "RecNum int identity," & "ZipFile NVarchar(50)," & "DvdName NVarchar(50)," & "SeqNo1 NVarchar(50)," & "SeqNo2 NVarchar(50)," & _
  293.                 "JobCode NVarchar(50)," & "ClientCode NVarchar(50)," & "TotalImages NVarchar(50)," & "TotalRecs NVarchar(50)," & "BatchCount NVarchar(50)," & "BatchDate NVarchar(50)," & "BatchSize NVarchar(50)," & "CONSTRAINT [pk_RecNum] PRIMARY KEY (RecNum)) ", conns)
  294.                 conns.Open()
  295.  
  296.                 cmdd.ExecuteNonQuery()
  297.  
  298.                 conns.Close()
  299.                 GC.Collect()
  300.                 GC.WaitForPendingFinalizers()
  301.             End If
  302.  
  303.             For ast As Integer = 0 To Form1.SelBat.Items.Count - 1
  304.  
  305.                 Dim o As String
  306.                 o = Form1.SelBat.Items(ast).SubItems(0).Text()
  307.                 Dim y As String
  308.                 Dim fPath As String = Form1.SelBat.Items(ast).SubItems(2).Text
  309.                 Dim directory3 As String = Path.GetDirectoryName(fPath)
  310.                 Dim split As String() = fPath.Split("\")
  311.                 Dim exfldr As String = split(split.Length - 1)
  312.                 y = exfldr
  313.  
  314.                 Dim count As String = Form1.SelBat.Items(ast).SubItems(1).Text
  315.                 Dim newbatsize As String
  316.                 newbatsize = Form1.BatSize.Text
  317.  
  318.                 Dim batchFolderNames As String = Form1.SelBat.Items(ast).SubItems(0).Text
  319.                 Dim fldr As String = Form1.Dir_folder.Text & "\CBATCH"
  320.                 Dim countOfMdb = Directory.GetFiles(fldr, "*.mdb", System.IO.SearchOption.AllDirectories).Length
  321.  
  322.                 Dim cmdB1 As String = "INSERT INTO [CardDeck] ([ZipFile],[DvdName],[SeqNo1],[SeqNo2],[JobCode],[ClientCode],[TotalImages],[TotalRecs],[BatchCount],[BatchDate],[BatchSize]) VALUES (@ZipFile, @DvdName, @SeqNo1, @SeqNo2, @JobCode, @ClientCode, @TotalImages, @TotalRecs, @BatchCount, @BatchDate, @BatchSize);"
  323.                 Dim cmdG1 As New OleDb.OleDbCommand(cmdB1, conns)
  324.                 cmdG1.Parameters.AddWithValue("@ZipFile", o)
  325.                 cmdG1.Parameters.AddWithValue("@DvdName", y)
  326.                 cmdG1.Parameters.AddWithValue("@SeqNo1", "00000001")
  327.                 cmdG1.Parameters.AddWithValue("@SeqNo2", "00000001")
  328.                 cmdG1.Parameters.AddWithValue("@JobCode", "Card Deck")
  329.                 cmdG1.Parameters.AddWithValue("@ClientCode", "DDC OS")
  330.                 cmdG1.Parameters.AddWithValue("@TotalImages", count)
  331.                 cmdG1.Parameters.AddWithValue("@TotalRecs", count)
  332.                 cmdG1.Parameters.AddWithValue("@BatchCount", countOfMdb)
  333.                 cmdG1.Parameters.AddWithValue("@BatchDate", Format(Now, "f"))
  334.                 cmdG1.Parameters.AddWithValue("@BatchSize", newbatsize)
  335.  
  336.                 conns.Open()
  337.  
  338.                 cmdG1.ExecuteNonQuery()
  339.  
  340.                 conns.Close()
  341.  
  342.                 GC.Collect()
  343.                 GC.WaitForPendingFinalizers()
  344.                 IDfield.Clear()
  345.             Next
  346.         End If
  347.  
  348.  
  349.  
  350.     End Sub
  351.  
  352.  
  353.     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  354.  
  355.         Form1.ProgressBar1.Increment(1)
  356.  
  357.         If Form1.ProgressBar1.Value = 25 Then
  358.             Form1.Label8.Text = "Started. Doing something"
  359.         ElseIf Form1.ProgressBar1.Value = 50 Then
  360.             Form1.Label8.Text = "Half Way There"
  361.         ElseIf Form1.ProgressBar1.Value = 75 Then
  362.             Form1.Label8.Text = "Working on it.. Almost Done!"
  363.         End If
  364.  
  365.         If Form1.ProgressBar1.Value = Form1.ProgressBar1.Maximum Then
  366.             Timer1.Stop()
  367.  
  368.             MsgBox("Complete!")
  369.             Form1.ProgressBar1.Value = 0
  370.  
  371.             Form1.Label8.Text = "Idle"
  372.             Button1.Enabled = True  '
  373.             If conns.State = ConnectionState.Open Then
  374.  
  375.                 conns.Close()
  376.                 GC.Collect()
  377.                 GC.WaitForPendingFinalizers()
  378.  
  379.             End If
  380.             If conn.State = ConnectionState.Open Then
  381.                 conn.Close()
  382.                 GC.Collect()
  383.                 GC.WaitForPendingFinalizers()
  384.             End If
  385.             If conctn.State = ConnectionState.Open Then
  386.                 conctn.Close()
  387.                 GC.Collect()
  388.                 GC.WaitForPendingFinalizers()
  389.             End If
  390.  
  391.  
  392.         End If
  393.  
  394.  
  395.     End Sub
  396.  
  397.  
  398.  
The above codes was my code, and I'm about to use progressbar while processing the application i made.
Jan 29 '16 #1
0 978

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Home User | last post by:
Hello, I am trying to find an application (if it exists) that actually creates .gent files (General Entity). Also, I am wondering if I can import .gent files into Dreamweaver? Perhaps with...
1
by: col head | last post by:
Hi all, I have a question regarding the configuration in the MS provided UI Process Application Block. I have a feeling that the UI application block itself has the session state (task)...
1
by: James Tsao | last post by:
I'm trying to run an external image processing application from a web application. The function below works for a windows application but when i try to call it from a web app, the image processing...
1
by: RJN | last post by:
Hi We are writing a data processing application wherein we compare data in 2 sets of tables say TableA and TableB and if the data in TableB is different than TableA, then we do an...
1
by: Code Monkey | last post by:
I know one varient of this question has been posted a lot, but this seems to be slighlty different. I've got the following code in my application <code> private static void Main() {
2
by: Lucky | last post by:
hi guys! i've got one interesting problem. one of my utility is generating data machine specific, i mean the data is generated in the culture that the machine has. my problem is with the...
8
by: WhiteWizard | last post by:
I guess it's my turn to ASK a question ;) Briefly my problem: I am developing a Windows app that has several User Controls. On one of these controls, I am copying/processing some rather large...
1
by: hardieca | last post by:
Hi, I'm building a forms app that parses thousands of text files. My boss insisted it have a GUI, to which I added an information console and a progress bar tracking the number of files parsed....
2
by: maverik | last post by:
Hi all. I'm writting some kind of text processing application (in C++). It has about 20 classes. Of course, it also has some settings (such as text color, text size, text family, etc). This...
6
NeoPa
by: NeoPa | last post by:
Progress Indicator in Access Introduction Access has a bad habit of getting tied up with its processing and not giving a clue as to whether it has crashed or not (The operating system and tools...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.