Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 209
  • Last Modified:

.NET Run thread in background windows form

I have a .NET windows forms application.  The process I have works fine, but the UI is unavailable while it is performed.  It takes about 30 seconds to complete.

Once the user selects a file to process, the UI locks up since it is using the same thread.  

What is the best way to perform this on a new thread and then alert the user with a messagebox it is completed?
If odiag.ShowDialog() = Windows.Forms.DialogResult.OK Then

                'set wait cursor
                Me.Cursor = Cursors.WaitCursor

                'Start the process
                Dim hte As New HTMLTableToCSVExcel(odiag.FileName)

                'display message to user when process completed
                MessageBox.Show(String.Format("File was saved in {0}", hte.savedPath), "File Created")

            End If

Open in new window

1 Solution

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now