Centering a image when the application is ran - c#

I have this application I made where when you click on the exe a Image Pops up that says Checking for Updates and if there isn't any it runs the main codes. But every time I click on it the image ends up somewhere random in the screen, is there a way to center the image in the screen to prevent it from doing that?

If your VS project type is a Windows Form Application you can just view the forms designer and set the StartPosition to CenterScreen or CenterParent

VS2010 WinForms (+ I assume) supports a splash screen. Add a form (a splash screen template is available) and in the Project properties select the new form. The Splash Screen appears center screen.
The splash screen will display until your startup form exits the Load event - or you can just end the app if you don't have anything more to do. Not sure what the code would be for a console app.

Related

MFC app - Class library WPF window icon does not show up in taskbar

I have an MFC window-based app. I added a C# class library that provides a second window for login to the app. This second window is meant to show before the main MFC window and once the user successfully logs in, it will go away and the main window will launch. The problem I am having is that when the login window is showing there is no taskbar icon for it. This did work correctly when the login window was an MFC dialog.
To make debugging this window easier I made a small MFC test app from which I can launch the login window with a button click. (the main program is cumbersome to test with). I added a C# class library to it just as it is in the main program. When I launch the app the main MFC dialog app shows up and the app's icon appears on the taskbar. When I click the button to launch the WPF window, it appears but there is no icon in the taskbar. This window does not show on the taskbar as a second window of the app as I would expect.
I am having a really hard time with google finding relevant info.
I have tried specifying an icon for the window vs. not specifying one.
I have tried adding ShowInTaskbar="True" to the window.
I have tried changing WindowStyle
I have tried playing with TaskbarItemInfo.
I tried following New taskbar icon when opening a window in WPF, but I don't really understand it well enough to say that it will fix my issue since I do not get my window showing up at all and if I did I would be fine with it being stacked.
I am not sure where else to go with this. Please let me know if there is anything unclear.

WP8 - How to disable the app Splash Screen for certain pages?

I have an app that uses a Splash Screen when it opens up, and it works fine.
The problem is that I've added a couple of pages that can be accessed via two live tiles, and the point is to let the user istantly load a certain section of the app without having to load the whole MainPage.xaml page, which is quite heavy to load.
These two pages are really simple and load almost istantly, but the app loads the Splash Screen anyways, and I don't like that.
Is there a way to "disable" the splash screen for a specific page?
Via C# or directly from the XAML, I don't know.
I enabled the Splash Screens simply by adding the SplashScreenImage.screen-WXGA.jpg (720p and 1080p as well) to the project main directory.
Thanks! :)
Sergio
No. You can't disable the splash screen. What you can do is to minimize all initialization work your app has to do so that the splash screen is shown for a minimum of time.
Sergio,
You can simulate a splash screen and decide based on how you were activated to show it or not. This sample shows one way to do it: https://code.msdn.microsoft.com/windowsapps/Splash-screen-sample-89c1dc78/
I would show it for the main xaml and others that take a long time to load and dismiss it in code.

How to animate image in splash screen for windows phone?

I am working on windows phone app in which I need to animate an object in the splash screen. In the below image you can see that, as soon as the splash screen appears. The ball.png bounces and only after completing the bounce, the app continues into the application. How to do this task?
You have to follow thoses steps to create an animated splashscreen :
You have to create a new Page on your application (called
SplashScreen.xaml) and set it as your 'HomePage'.
You create a storyboard to build your animation.
You subscribe to the Loaded event of the SplashScreen page, and start your
storyboard.
When the storyboard is done (subscribe to the Completed event), you can navigate to your
Homepage.
Hope it helps !
Use Extended Splash Screen and set the animation to the image. For more details visit here.

C# Loading Screen While Components Load

I want to make a screen that is displaying the message Login in a label while all the components are loading in a form.When i execute the game it stays in blank screen for about 5 seconds before showing all the design so i want it to load until it is fully loaded.
Just create a new "splash screen" form that you hide when loading is complete. Don't display your current form until loading is complete.
This is one way to do it:
Initialize and show the splash window
Initialize but keep the main window hidden
When main window is fully loaded, show it and close the splash window
There is a lot of sample code out there, just google for it. Some links:
http://crazorsharp.blogspot.se/2009/06/creating-splash-screen-in-net-with.html
http://www.codeproject.com/Articles/5454/A-Pretty-Good-Splash-Screen-in-C
http://www.codersource.net/MicrosoftNet/CWinForms/CreatingaSplashScreeninC.aspx

How can I be notified when Windows XP fades the screen to gray?

We have an application developed in C# with WPF (.NET Framework 3.0)
The main window has a glass border, and a child window containing a WebBrowser is centered within it:
WPF main window
-> Child window - frame control
-> Page
-> WindowsFormsHost
-> WebBrowser
Because we used .NET 3.0, we have to put WebBrowser in WindowsFormsHost, and it can't show if we set the window property AllowTransparency to true.
Now, on Windows XP, when the user clicks the Shutdown button on the Start menu, a dialog is displayed with various choices (shutdown, restart, etc.) while behind it the entire desktop appears to fade from color to shades of gray. When this occurs, our main window becomes hidden, while the page window is still displayed on the screen.
We have already set page window's owner to be the main window, but this did not help. Therefore, I have come to the conclusion that I must intercept the "fade to gray" event and... do something to mitigate this ugliness. So: does anyone know how I might allow my program to be notified prior to the fade to gray?
As I know there is no way to be notified when Windows fades the screen to gray.
System.SystemEvents class doesn't have such an event either.

Categories

Resources