0

Im new to the .net programming, I just want to try and help my company improve the system. I want to show the progress bar when i click the compute button, the compute button is execute the stored procedure.

I have try to search online, youtube for create the progress bar, but unfortunately that is no guide for execute SP.

    Private Sub btnCompute_Click(ByVal sender As System.Object, ByVal e As 
    System.EventArgs) Handles btnCompute.Click

    btnCompute.Enabled = False
    btnRefresh.Enabled = False
    Me.Cursor = Cursors.WaitCursor


    Try
        Dim o As New clsDataProviderForPY
        Call o.PY_PostCalc_Post(m_ds, InfoCycle.YearMonth, InfoCycle.Run, InfoCycle.Cycle)
        Call LoadComputedTrx()

    Catch ex As Exception
        btnCompute.Enabled = True
        btnRefresh.Enabled = True
        Me.Cursor = Cursors.Arrow

        MsgErr(ex)
    End Try

    Me.Cursor = Cursors.Arrow
    btnCompute.Enabled = True
    btnRefresh.Enabled = True
    MsgBox("Done.", MsgBoxStyle.Information, Me.Text)


    TabMain.SelectedTab = tpComputed

End Sub

After i add in timer and the progress bar in the form, what should i write in code for the progress bar running when i click the btncompute button.

  • What DBMS are you using? How does it report progress back to the caller of the stored procedure? Without knowing that, you can't possibly report progress. – Ken White Apr 24 '19 at 01:44
  • 1
    As suggested by @KenWhite, you can't report progress that you can't measure. A `ProgressBar` control isn't magic. If you can't measure progress then you can set the `Style` property to `Marquee` and you then get a continuous animation. You'll have seen the same thing in various other apps for the same reason. – jmcilhinney Apr 24 '19 at 01:51

0 Answers0