Click here to Skip to main content
15,860,861 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Raise Event on another Form Pin
jsc426-Jul-22 6:23
professionaljsc426-Jul-22 6:23 
QuestionCopy Record(s) from 1 Database to Another Database with the same Tables Pin
crmfghtr20-Jun-22 16:42
crmfghtr20-Jun-22 16:42 
AnswerRe: Copy Record(s) from 1 Database to Another Database with the same Tables Pin
Victor Nijegorodov20-Jun-22 20:24
Victor Nijegorodov20-Jun-22 20:24 
QuestionGet Process Percentage Pin
EngrImad18-Jun-22 8:33
EngrImad18-Jun-22 8:33 
AnswerRe: Get Process Percentage Pin
PIEBALDconsult18-Jun-22 8:35
mvePIEBALDconsult18-Jun-22 8:35 
GeneralRe: Get Process Percentage Pin
EngrImad19-Jun-22 0:22
EngrImad19-Jun-22 0:22 
GeneralRe: Get Process Percentage Pin
Dave Kreskowiak19-Jun-22 8:00
mveDave Kreskowiak19-Jun-22 8:00 
GeneralRe: Get Process Percentage Pin
EngrImad19-Jun-22 3:57
EngrImad19-Jun-22 3:57 
Another Option here
we could use "BackgroundWorker" as following:

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        ProgressBar1.Maximum = ???? Here what should put?
        BackgroundWorker1.WorkerReportsProgress = True
        BackgroundWorker1.RunWorkerAsync()
    End Sub

      Private Sub BackgroundWorker1_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
       
       'We can measure this loop for example
       For t = 0 To myMax
            Label1.Text = t
            BackgroundWorker1.ReportProgress(t)
            Threading.Thread.Sleep(100)
        Next

      'But we need to measure process percentage of (My_Process()) , 
      'No have (t) digital counter to use in (BackgroundWorker1.ReportProgress(t))
      'So what is the solution here???


    End Sub

   Private Sub BackgroundWorker1_ProgressChanged(sender As Object, e As ProgressChangedEventArgs) Handles BackgroundWorker1.ProgressChanged
        Label1.Text = e.ProgressPercentage.ToString() & " %"
        ProgressBar1.Value = e.ProgressPercentage
        ProgressBar1.Refresh()
   End Sub

Private Sub My_Process()
---- Code
End Sub


modified 19-Jun-22 10:31am.

AnswerRe: Get Process Percentage Pin
Richard Deeming19-Jun-22 21:41
mveRichard Deeming19-Jun-22 21:41 
AnswerRe: Get Process Percentage Pin
David Mujica22-Jun-22 3:42
David Mujica22-Jun-22 3:42 
QuestionStrange behavior readline Pin
JR21214-Jun-22 1:05
JR21214-Jun-22 1:05 
AnswerRe: Strange behavior readline Pin
Richard MacCutchan14-Jun-22 5:16
mveRichard MacCutchan14-Jun-22 5:16 
GeneralRe: Strange behavior readline Pin
JR21216-Jun-22 2:16
JR21216-Jun-22 2:16 
AnswerRe: Strange behavior readline Pin
Alan N14-Jun-22 5:30
Alan N14-Jun-22 5:30 
GeneralRe: Strange behavior readline Pin
JR21216-Jun-22 2:13
JR21216-Jun-22 2:13 
QuestionDatabase relating entity having various data members Pin
lazy_dude12-Jun-22 20:17
lazy_dude12-Jun-22 20:17 
AnswerRe: Database relating entity having various data members Pin
Richard Deeming12-Jun-22 21:26
mveRichard Deeming12-Jun-22 21:26 
GeneralRe: Database relating entity having various data members Pin
lazy_dude12-Jun-22 23:03
lazy_dude12-Jun-22 23:03 
QuestionDataGridView Multi Layer Header Pin
EngrImad11-Jun-22 3:33
EngrImad11-Jun-22 3:33 
SuggestionRe: DataGridView Multi Layer Header Pin
Richard MacCutchan11-Jun-22 4:16
mveRichard MacCutchan11-Jun-22 4:16 
GeneralRe: DataGridView Multi Layer Header Pin
EngrImad11-Jun-22 7:58
EngrImad11-Jun-22 7:58 
GeneralRe: DataGridView Multi Layer Header Pin
Richard MacCutchan11-Jun-22 8:49
mveRichard MacCutchan11-Jun-22 8:49 
GeneralRe: DataGridView Multi Layer Header Pin
EngrImad18-Jun-22 8:31
EngrImad18-Jun-22 8:31 
Questionhelp edit config file Pin
Benjamindh8-Jun-22 11:14
Benjamindh8-Jun-22 11:14 
AnswerRe: help edit config file Pin
Dave Kreskowiak8-Jun-22 14:55
mveDave Kreskowiak8-Jun-22 14:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.