Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Awesome dialogs for Windows Desktop applications built with Microsoft .NET (WinForms)

License

NotificationsYou must be signed in to change notification settings

ookii-dialogs/ookii-dialogs-winforms

Repository files navigation

README.md
Ookii.Dialogs.WinForms

Ookii.Dialogs.WinForms

A class library for Windows Forms applications providing several common dialogs. Included are classes for task dialogs, credential dialog, progress dialog, input dialogs, and common file dialogs.

NuGet VersionNuGet Downloads.NET Framework

Give a Star! ⭐

If you like or are using this project please give it a star. Thanks!

Getting started

Install theOokii.Dialogs.WinForms package from NuGet:

Install-Package Ookii.Dialogs.WinForms

The included sample applicationOokii.Dialogs.WinForms.Sample demonstrate the dialogs for Windows Forms. View the source of this application to see how to use the dialogs.

Windows Presentation Foundation (WPF) compatibility

If you're looking to use these common dialogs on a WPF application, check outOokii.Dialogs.Wpf.

Included dialogs

Task dialog

Task dialogs are a new type of dialog first introduced in Windows Vista. They provide a superset of the message box functionality.

A task dialog as it appears on Windows 10

A task dialog with command links as it appears on Windows 10

TheOokii.Dialogs.WinForms.TaskDialog classe provide access to the task dialog functionality. TheTaskDialog class inherits fromSystem.ComponentModel.Component and offers full support for the Windows Forms designer and component designer of Visual Studio.

TheTaskDialog class requires Windows Vista or a later version of Windows. Windows XP is not supported. Note that it is safe to instantiate theTaskDialog class and set any of its properties; only when the dialog is shown will aNotSupportedException be thrown on unsupported operating systems.

Progress dialog

Progress dialogs are a common dialog to show progress during operations that may take a long time. They are used extensively in the Windows shell, and an API has been available since Windows 2000.

A progress dialog as it appears on Windows 10

TheOokii.Dialogs.WinForms.ProgressDialog class provide a wrapper for the Windows progress dialog API. TheProgressDialog class inherits fromSystem.ComponentModel.Component and offers full support for the Windows Forms designer and component designer of Visual Studio. TheProgressDialog class resembles theSystem.ComponentModel.BackgroundWorker class and can be used in much the same way as that class.

The progress dialog's behaviour of theShowDialog function is slightly different than that of other .NET dialogs; It is recommended to use a non-modal dialog with theShow function.

TheProgressDialog class is supported on Windows XP and later versions of Windows. However, the progress dialog has a very different appearance on Windows Vista and later (the image above shows the Vista version), so it is recommended to test on both operating systems to see if it appears to your satisfaction.

When using Windows 7 or later, theProgressDialog class automatically provides progress notification in the application's task bar button.

Credential dialog

TheOokii.Dialogs.WinForms.CredentialDialog class provide wrappers for theCredUI functionality first introduced in Windows XP. This class provides functionality for saving and retrieving generic credentials, as well as displaying the credential UI dialog. This class does not support all functionality ofCredUI; only generic credentials are supported, thing such as domain credentials or alternative authentication providers (e.g. smart cards or biometric devices) are not supported.

A credential dialog as it appears on Windows 10

TheCredentialDialog class inherits fromSystem.ComponentModel.Component and offers full support for the Windows Forms designer and component designer of Visual Studio.

On Windows XP, theCredentialDialog class will use theCredUIPromptForCredentials function to show the dialog; on Windows Vista and later, theCredUIPromptForWindowsCredentials function is used instead to show the new dialog introduced with Windows Vista. Because of the difference in appearance in the two versions (the image above shows the Vista version), it is recommended to test on both operating systems to see if it appears to your satisfaction.

Input dialog

The input dialog is a dialog that can be used to prompt the user for a single piece of text. Its functionality is reminiscent of the Visual BasicInputBox function, only with a cleaner API and UI.

An input dialog as it appears on Windows 10

TheOokii.Dialogs.WinForms.InputDialog class provides the input dialog functionality for Windows Forms.

Unlike the other classes in this package, this class is not a wrapper for any existing API; the dialog uses a custom implementation in Windows Forms. This dialog is supported on Windows XP and later versions of windows; on Windows Vista and later, the visual styles API is used to draw the dialog to mimic the appearance of task dialogs, as shown in the image above.

TheInputDialog class inherits fromSystem.ComponentModel.Component and offers full support for the Windows Forms designer and component designer of Visual Studio.

Vista-style common file dialogs

Windows Vista introduced a new style of common file dialogs. As of .NET 3.5 SP1, the Windows FormsOpenFileDialog andSaveFileDialog class will automatically use the new style under most circumstances; however, some settings (such as settingShowReadOnly totrue) still cause it to revert to the old dialog. TheFolderBrowserDialog still uses the old style.

The Vista-style folder browser dialog as it appears on Windows 10

TheOokii.Dialogs.WinForms.VistaOpenFileDialog,Ookii.Dialogs.WinForms.VistaSaveFileDialog andOokii.Dialogs.WinForms.VistaFolderBrowserDialog provide these dialogs for Windows Forms (note that in the case of theOpenFileDialog andSaveFileDialog it is recommended to use the built-in .NET classes unless you hit one of the scenarios where those classes use the old dialogs).

The classes have been designed to resemble the original Windows Forms classes to make it easy to switch. When the classes are used on Windows XP, they will automatically fall back to the old style dialog.

The Vista-style file and folder dialogs classes for Windows Forms inherit fromSystem.ComponentModel.Component and offer full support for the Windows Forms designer and component designer of Visual Studio.

Additional functionality

Three additional classes are provided in theOokii.Dialogs.WinForms library. These classes are used to support theInputDialog (with the exception of the Aero glass functionality, which theInputDialog does not use) but are made public for your convenience.

TheAdditionalVisualStyleElements class provides some visual style elements used by task dialogs on Windows Vista and later.

TheGlass class provides functionality for extending Aero glass into the client area of a window on Windows Vista and later, and for drawing text on a glass surface.

TheExtendedForm class serves as an alternative base class for forms, and provides functionality to automatically use the system font (e.g. Tahoma on XP and Segoe UI on Vista and later), and easy access to some of the functionality of theGlass class.

Release History

Click on theReleases tab on GitHub.


Copyright © 2009-2021 Ookii Dialogs Contributors - Provided under theBSD 3-Clause "New" or "Revised" License.


[8]ページ先頭

©2009-2025 Movatter.jp