All you have to do is set the properties that you are setting to be *before* the lock window update. I didn't notice this, but since they're after and some of the properties affect drawing, they're being ignored.
Put these before the lock window update.
this.TopMost = true;
this.ShowInTaskbar = false;
this.FormBorderStyle = FormBorderStyle.None;
this.StartPosition = FormStartPosition.CenterScreen;
The reason that your 'workaround' works, is because of the same reason- it's before the lockwindowupdate.
And the LockWindowUpdate should be *outside* of the try...finally block. Always put what you're trying to catch outside- if something else happens to kill your app before you get to the initial LockWindowUpdate, you'll be trying to unlock without having locked. Not that this is necessarily going to do something bad... but it's not a good practice.
public SplashScreen()
{
this.TopMost = true;
this.ShowInTaskbar = false;
this.FormBorderStyle = FormBorderStyle.None;
this.StartPosition = FormStartPosition.CenterScreen;
LockWindowUpdate(this.Handle);
try
{
Image img = Bitmap.FromFile(LetsYoConfig.SplashFileName);
this.BackColor = this.TransparencyKey = Color.White;
Bitmap b = new Bitmap(img);
b.MakeTransparent(b.GetPixel(1,1));
this.BackgroundImage = splashImage = (Image) b;
this.Size = this.splashImage.Size;
}
finally
{
LockWindowUpdate(IntPtr.Zero);
}
}
That should fix your problem.