How can we show startup picture when my application starts as every software hows like Photoshop ,vs word etc?? I planed to paste it on form and then show it but there is top blue bar coming that has controls etc any idea/
The current spotlight image can be found at C:\ProgramData\Microsoft\Windows\SystemData\<User's SID>\ReadOnly\LockScreen_O, while the current and all previous images can be found in %localappdata%\Packages\Microsoft. Windows.
Press the Windows key to launch the Start Screen. Click on the User Tile on top right corner of the Start screen. Select Change Account Picture. Click one of the provided background images or use the Browse button and select any image from your computer, Bing, SkyDrive, or even your camera.
If you're looking for the simplest way, you can use the .NET Framework's excellent built-in support for splash screens. You'll have to put aside any irrational fears that you might have of including something with the name "Visual Basic" in a C# application, but this way will save you from having to roll your own custom solution and worry about things like multi-threading, invoking, and all that. It all compiles down to the same IL in the end anyway. Here's how it works:
Add a reference to Microsoft.VisualBasic
to your project.
Add a new form (named something like SplashForm
) to serve as your splash screen.
To make it look more like a proper splash screen, set the form's FormBorderStyle
property to "None" and its StartPosition
property to "CenterScreen". You can add any controls or images to this form that you want to be displayed on the splash screen to this form.
Add the following code to your Project.cs
file:
using System;
using System.Windows.Forms;
using Microsoft.VisualBasic.ApplicationServices;
namespace WindowsFormsApplication1
{
static class Program
{
[STAThread]
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
new SplashScreenApp().Run(args);
}
}
public class SplashScreenApp : WindowsFormsApplicationBase
{
protected override void OnCreateSplashScreen()
{
this.SplashScreen = new SplashForm();
this.SplashScreen.ShowInTaskbar = false;
this.SplashScreen.Cursor = Cursors.AppStarting;
}
protected override void OnCreateMainForm()
{
//Perform any tasks you want before your application starts
//FOR TESTING PURPOSES ONLY (remove once you've added your code)
System.Threading.Thread.Sleep(2000);
//Set the main form to a new instance of your form
//(this will automatically close the splash screen)
this.MainForm = new Form1();
}
}
}
If you want to do something fancy like create a transparent splash screen in the style of Adobe Photoshop, you can add an alpha-channel PNG image to your project's Resources file, and then add the following code to your splash screen form, replacing splashImage
with the path to your embedded image resource:
protected override void OnPaintBackground(PaintEventArgs pevent)
{
Graphics g = pevent.Graphics;
g.DrawImage(splashImage, new Rectangle(0, 0, this.Width, this.Height));
}
protected override void OnPaint(PaintEventArgs e)
{
//Do nothing here
}
For this to work, make sure that you have double buffering turned off, or else you'll get a black background to your form. There's really no reason to double buffer a splash screen anyway.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With