I have a main form which does processing for an extended period of time. Normally, progress bars are used to show either the loading status or simply show the program is still running/hasn't freezed. For this form, I wanted to give it a more snazzy look by reusing a common loading GIF found on the web that many users would be familiar with. This is how I implement said GIF:ShowLoadingGif();              //Heavy liftingHideLoadingGif();private void ShowLoadingGif(){    this.Enabled = false;    Point formCenterPt = new Point()    {        X = this.Location.X + (this.Width/2),        Y = this.Location.Y + (this.Height/2)    };    loadingThread = new Thread(() => ShowLoading(formCenterPt));    loadingThread.IsBackground = true;    loadingThread.Name = Loading gif;    loadingThread.Start();}   private void HideLoadingGif(){    try    {        this.Enabled = true;        if(loadingThread.IsAlive)        loadingThread.Abort();    }    catch (Exception ex)    {        Log(String.Concat(Loading gif thread release failed: ,ex));    }}private void ShowLoading(Point parentCenter){    frmLoadingGif loading = new frmLoadingGif();    Point offsetPt = new Point()    {        X = parentCenter.X - (loading.Width /2),        Y = parentCenter.Y - (loading.Height/2)    };    loading.StartPosition = FormStartPosition.Manual;    loading.Location = offsetPt;    loading.ShowDialog();}What this does is produces a loading GIF (I grabbed mine from ajaxloader) in the center of the form while processing is ongoing, and also disables the form. My question is, whether or not what I did was overkill for something as simple as an inprogresss status, or if using threads in this way is the best way to do it. I realize that using a control on the main form would have been easier, but I couldn't find a way to do so with a GIF while also making the background completely transparent. Why have I chosen to use a form for showing the GIF?The alternative would have been to add the picture box to the main form. However, this didn't seem the best solution because I wanted to center the GIF to the form itself, and with the TableLayoutPanel I was using, you can't simply change the location of a control in that manner (please correct me if I'm wrong here). I also wanted to keep the transparency, threading, and other attributes of the picturebox control separate from the main form so I could reuse it elsewhere.Finally, I wanted to show the GIF loading on top of the current form, and not just in the corner/bottom in its own section like a progress bar would. As you'll see in the picture, the loading GIF is shown on top of the control behind it, a DataGridView.
Loading GIF form on a Windows console app using threads
c#;multithreading;thread safety;winforms;animation