1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/sesametech-group-SplashScreen

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
В этом репозитории не указан файл с открытой лицензией (LICENSE). При использовании обратитесь к конкретному описанию проекта и его зависимостям в коде.
Клонировать/Скачать
Внести вклад в разработку кода
Синхронизировать код
Отмена
Подсказка: Поскольку Git не поддерживает пустые директории, создание директории приведёт к созданию пустого файла .keep.
Loading...
README.md

SplashScreen

输入图片说明

A lightweight and easy-to-use splash screen control that starts life before the Application Form

Introduction

Awhile back, when I first browsed around for splash screen examples, I couldn't find anything that met my requirements for a splash screen. I wanted something simple, flexible, reliable, intrinsically safe -- no threads or child controls etc. -- and that would start up immediately, stay on top, go away when required and also reappear if wanted. I have noticed there are some good examples based entirely within .NET using Forms, whereas the approach I have taken uses the System.Runtime.InteropServices to create a topmost top-level window from a Control-based class. I prefer this approach, as I have found it to be reliable and very flexible with regards to customisation. Because of the required simplicity, the control handles its own painting, which provides the freedom to use the GDI to create an application-personalised splash screen.

Background

I had been developing an application that required a splash screen. The motivation to provide a splash screen is given by any delay between launching the application and the user interface subsequently becoming available.

There's something reassuring about an application that starts up straightaway, without a splash screen, ready to use. However, if a program has any reason to initialize before starting, which implies a potential for delay or failure, then it would be best to present something right away via a splash screen with a commentary. This can have its benefits, as well:

A branding opportunity

With a visually pleasing background graphic for your banner, you can immediately create a better first impression with your users. It's an opportunity to brand your software and, just as importantly, brand a version. Users of Office, for instance, know immediately what version they are starting up, 2003 or 2007, for example.

A moment of greater user attention

It's a good opportunity to take advantage of the increased attention you have from your user. After all, they've just thought about your software and launched it. So whilst loading you could, for example, remind them to visit your website for up-to-date news about your products.

A chance to relay start-up and configuration information

If your program relies on establishing connections -- or dynamically loads plug-ins or the like -- then a splash screen can make the user aware of what you are connecting to or loading. This information could prove useful to both you and your users.

Using the Code

To use the class SplashScreen, add the file SplashScreen.cs to your application. Locate the entry point Main in your program, typically in Program.cs for a generated project.

SplashScreen is implemented as a Singleton pattern class. This is a class that allows a maximum of one instance of itself. This is achieved by using a private constructor with a static member reference to the created instance and public static access to that instance. SplashScreen also provides public static methods to manage using the control.

After the calls to the application visual styles and text rendering settings, initialize SplashScreen with your image resource (if required) and call the static method BeginDisplay() to present the splash screen. From now on, use the static methods SetTitleString and SetCommentaryString at your start-up checkpoints to keep the user informed of progress. Remember that you initialize SplashScreen in Main, but you will continue to use it and end its display in your Forms application. The principal places of interest in your application's main form are the OnLoad and OnShown overrides. Of most importance is that you call the static method EndDisplay() in the OnShown override.

Комментарии ( 0 )

Вы можете оставить комментарий после Вход в систему

Введение

Лёгкий и простой в использовании элемент управления заставкой, который начинает работу до формы приложения. Развернуть Свернуть
Отмена

Обновления

Пока нет обновлений

Участники

все

Недавние действия

Загрузить больше
Больше нет результатов для загрузки
1
https://api.gitlife.ru/oschina-mirror/sesametech-group-SplashScreen.git
git@api.gitlife.ru:oschina-mirror/sesametech-group-SplashScreen.git
oschina-mirror
sesametech-group-SplashScreen
sesametech-group-SplashScreen
master