deckolz.blogg.se

Gif windows 10 loading
Gif windows 10 loading











gif windows 10 loading

You have this in ShowLoadingGif() Point formCenterPt = new Point()Īnd this in ShowLoading() Point offsetPt = new Point() I don't know much about threading, so I can't really comment on that, but there is an opportunity to extract some logic that I am sure is used elsewhere in your project. As you'll see in the picture, the loading GIF is shown on top of the control behind it, a DataGridView.

gif windows 10 loading

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.įinally, 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. 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). The alternative would have been to add the picture box to the main form. Why have I chosen to use a form for showing the GIF? 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. 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. 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. Loading.StartPosition = FormStartPosition.Manual Private void ShowLoading(Point parentCenter)įrmLoadingGif loading = new frmLoadingGif() Log(String.Concat("Loading gif thread release failed: ",ex)) LoadingThread = new Thread(() => ShowLoading(formCenterPt)) This is how I implement said GIF: ShowLoadingGif() Normally, progress bars are used to show either the loading status or simply show the program is still running/hasn't freezed.įor 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. I have a main form which does processing for an extended period of time.













Gif windows 10 loading