.NET Compact Framework 3.5 animated transparent wait cursor

I would like to display a “pending cursor” for the user when he needs to wait for something to load. The cursor should be an animated series of bitmaps.

I can use UserControl, which I can add to the form, but UserControl is not transparent.

I took a sample code here ( http://www.microsoft.com/downloads/details.aspx?FamilyId=33817CE0-B5E9-4B8E-916B-E6A381E03789&displaylang=en ). Although it works, I want to be able to separate the animation from the form in a separate object. When I do this, it works for a sample application, but not for my actual application.

Any suggestions? This is in .NET CF 3.5

+3
source share
2 answers

What you are trying to achieve is actually quite difficult because Windows CE does not support transparent windows. You can use Colorkey transparency to draw an image with transparency in the window, but if this window overlaps another window (as is the case with UserControl on top of the form), you will get either a gray background or a “hole” completely on the desktop, depending on , did you redefine OnPaintBackground in UserControl.

What you need to do to make it work, UserControl must actually call its parent and call its OnPaint method with the borders of the clipping region before you draw the UserControl itself.

, , , , , IoC. , ( , ).

+2

- native CF - :

Cursor.Current = Cursors.WaitCursor; // Show the "Loading" image in the middle of the screen

:

Cursor.Current = Cursors.Default;
+2

Source: https://habr.com/ru/post/1713777/


All Articles