Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8206795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:47:33+00:00 2026-06-07T08:47:33+00:00

I use a background worker to do some tasks, when the background worker completed

  • 0

I use a background worker to do some tasks, when the background worker completed successfully a message box appears, the problem I have is if i minimize my form and the message box appears when i click on the form the message boxstill appears to be miminized unless i click on the message box – i can see it in the taskbar at the bottom but its minimized?

Would it be possible for when the user clicks on the form in the taskbar then the message box to appear with the form?

Currently I have tried adding the following before hte message box however the messagebox still appears to be minimized.

me.activate

Update

Sorry for not adding the coding, i thought as it was basic coding it wouldnt matter but here it is….

Private Sub BGWorker_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BGWorker.DoWork


            If Not worker.CancellationPending Then

‘ Do code

                If worker.CancellationPending Then
                    e.Cancel = True
‘ Do Code
                    Exit Sub
                End If

            End If


End Sub


  Private Sub BGWorker_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BGWorker.RunWorkerCompleted
            Me.Activate()
            If e.Cancelled Then
Messagebox.show(“Cancelled”)
            Else
Messagebox.show(“Successful”)

                End If
    End Sub

The problem is if I leave my screen at the top of the other screens then its fine the message box appears however if its minimised ir if i have other windows covering the form then the message box stays minimized unless i click on it in the taskbar.

I thought the me.activate would help me in the sense that the message box would only ever appear within the form.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T08:47:36+00:00Added an answer on June 7, 2026 at 8:47 am

    I made a test project using your code and I was able to reproduce and fix the problem. The Activate method does not un-minimize the form. To do that, you need to set the WindowState property. Try this:

    Private Sub BGWorker_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BGWorker.RunWorkerCompleted
        Me.WindowState = FormWindowState.Normal  ' Add this line
        Me.Activate()
        If e.Cancelled Then
            Messagebox.show(“Cancelled”)
        Else
            Messagebox.show(“Successful”)
    
        End If
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to design a form with an input inside it. I use background
I've got a background worker on a form and I've written some long running
I have a VB.net project which uses a background worker to do some stuff.
Is it possible/recommended to use background worker threads with the web browser control? I
I am trying to use a background worker in order to retrieve a large
I have method which create background thread to make some action. In this background
I call obackgroundworker.CancelAsync(); on a background worker currently doing some work in another thread
C# 2005 I am using a background worker to process some login information. However,
I have a WPF application with two background worker threads that operate while loading.
I am using background worker to do a long process on some files. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.