Make my application vague while Show "Spinning Wheel” [duplicate] - c#

This question already has answers here:
How can I make the cursor turn to the wait cursor?
(11 answers)
Closed 9 years ago.
I have Windows Forms application and while some operation is in progress i want to show Spinning Wheel:
http://preloaders.net/en/search/circle
So i created pictureBox and while my operation is in progress i want to see that Wheel but i want it to seen like in web pages, i want it over my controllers at the middle of the application and if it possible i want the rest of my application become vague.
is it possible ?

Simple solution:
pictureBox1.BringToFront();
pictureBox1.Dock = DockStyle.Fill;
Another option is transparent background and FormBorderStyle set to None. Show this form with ShowDialog() to avoid interaction with main form while it is shown.
NOTE: WinForms is not a Web application. Usually when you have some background process, then you set waiting cursor and disable controls. If you want to display progress, then can use ProgressBar.

Related

How to make Windows form applications Responsive to multiple screen resolutions? [duplicate]

This question already has answers here:
How to make the UI responsive in Winforms [closed]
(2 answers)
How to make size of Window responsive for every type of screen resolution using Windows form [closed]
(1 answer)
Closed 4 years ago.
I have created an Application in Visual Studio 2015 using C# as a P.L. I created it in my laptop whose resolution is 1920 * 1080 (as recommended). It runs smoothly on may laptop, the designs are meant to be as expected. But when I try to run it to another any screen resolution it just zoomed out and the designs, windows form components are not visible, inshort the GUI got crashed. I don't used any of those Flowlayout panel. Is there any setting or configurations on my project that i need to do to fix my problem ?
You may set the application windows form size to maximized so that it will fit in all resolutions by Set the System.Windows.Forms.Form.WindowState to FormWindowState.Maximized and then used flow layout/dock combinations to handle manual resizing
Please refer this video

How to check if the WPF Window is being dragged [duplicate]

This question already has answers here:
Determining when a WPF window is being moved
(3 answers)
Closed 7 years ago.
In need to get whether or not my WPF application's Window is currently in the process of being dragged or re-sized. I need to prevent a specific action from happening if this is the case.
I need to check if the window is currently in any situation where the mouse is being held down on the the part of the window that can preposition it.
I am assuming there is probably some information somewhere on the
Application.Current.MainWindow
property. Or maybe there is a few events that I need to keep track of to have this information.
Any ideas how I would do this? Thanks in advance.
Subscribe to the LocationChanged event.
Set the ResizeBegin and ResizeEnd event. They should both fire when the application is being moved, and disable your feature when Begin is called and until End finishes.
EDIT: Just realized this is WPF, in which case check this article: Determining when a WPF window is being moved

How can I change application's image when it is in fast-app-switching in Windows Phone? [duplicate]

This question already has an answer here:
windows phone change deactivated app image
(1 answer)
Closed 9 years ago.
I want to change image that my application's screenshot when it is in background.
I don't want to show my application's screenshot when it is in app-switching. I want to change it and put an image, how can I do it?
Thanks.
There is no way to do this.
The purpose of using a screen shot of the app when the use left it is to provide appropriate context to the user.
If the data being displayed for potentially extended periods of time would impact the application (as is common with some games) then the appropriate action to take would be to take appropriate action within the app/game when the user returns to the app.

Windows Desktop Size changed event? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Detect change of resolution c# WinForms
I have an application written in C# where my window is docked to the edge of the screen.
I need to know where I can find the event if the resolution has changed so I can call the Dock method so I can repaint my window.
On the form object I can only see the SystemColorsChanged event.
You're looking for the SystemEvents.DisplaySettingsChanged event.

Prevent window from snapping to screen edges [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How do you disable Aero Snap in an application?
Is there a way to prevent a WPF window from snapping to screen edges (i.e. Aero snap)?
I know this can be disabled by the user in the OS, but I want to prevent only my window from getting rearranged.
For example, modal windows do not get snapped like that. I imagine it can be set for a WPF window as well, but I do not know how.
There's no direct way of doing this except you set ResizeMode="NoResize" and implement the resize behavior manually or EXTREME SOLUTION could be (on an application basis) modifying a shortcut to your .exe, on the Compatibility tab, check "Disable desktop composition".

Categories