Click here to Skip to main content
13,253,863 members (66,012 online)
Click here to Skip to main content
Add your own
alternative version


241 bookmarked
Posted 7 Nov 2007

VDialog (Vista TaskDialog for Windows XP)

, 27 Mar 2013
Rate this:
Please Sign up or sign in to vote.
Vista-like TaskDialog control for .NET Framework 2.0, compatible with Windows XP

VDialog using LockSystem feature.

VDialog using LockSystem feature

Sample customized VDialog.

Sample customized VDialog

Sample security VDialog.

Sample security VDialog

Expandable VDialog with footer (RightToLeft property set to RightToLeft.Yes and RightToLeftLayout property set to True).

Expandable VDialog with footer


Many programmers would like to use Windows Vista TaskDialog on earlier systems like Windows 2000/XP. Unfortunately this is not possible.

There are some TaskDialog implementations on the Internet, but none of them are written in VB.NET. I decided to write my own version of a TaskDialog-like form with all the functionality of Vista TaskDialog. It is almost fully compatible with the MessageBox class. And there are some features of Vista TaskDialog implemented (the rest of them will be implemented later). Some features, which are not implemented, can be emulated using custom controls (like radio buttons or progress bar — see the first screenshot above).

Using the Code

The VDialog class is compatible with the MessageBox class so it can be used in the same way, e.g.:

VDialog.Show(Me, "Text", "Caption", MessageBoxButtons.YesNo, MessageBoxIcon.Error)

To customize the appearance of VDialog, one must create a VDialog object, set its properties and then invoke the Show() method, e.g.:

Dim vd As New VDialog()
With vd
    .WindowTitle = "Windows Vista"
    .Owner = Me
    .MainInstruction = "You must click OK button to continue"
    .Buttons = New VDialogButton() _
              { New VDialogButton(VDialogResult.OK), _
                New VDialogButton(VDialogResult.Continue) }
    .MainIcon = VDialogIcon.SecurityShieldBlue
    .DefaultButton = VDialogDefaultButton.None
    .Content = "If you don't know what to do, click Cancel button."
    .LockSystem = True
    .CustomControl = New MyCustomControl()
End With


Almost Full Compatibility with the MessageBox Class

Existing code can be easily changed to one which uses the VDialog class instead of the MessageBox class by changing the MessageBox.Show(…) invocation to the VDialog.Show(…) invocation.

Supported methods:

Show(String) As DialogResult
Show(String, String) As DialogResult
Show(String, String, MessageBoxButtons) As DialogResult
Show(String, String, MessageBoxButtons, MessageBoxIcon) As DialogResult
Show(String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton) _
	As DialogResult
Show(String, String, MessageBoxButtons, MessageBoxIcon, _
	MessageBoxDefaultButton, MessageBoxOptions) As DialogResult
Show(IWin32Window, String) As DialogResult
Show(IWin32Window, String, String) As DialogResult
Show(IWin32Window, String, String, MessageBoxButtons) As DialogResult
Show(IWin32Window, String, String, MessageBoxButtons, MessageBoxIcon) As DialogResult
Show(IWin32Window, String, String, MessageBoxButtons, _
	MessageBoxIcon, MessageBoxDefaultButton) As DialogResult

Advanced Usage

The VDialog class can also be used in another way. One can create a VDialog object and set its properties, such as:

  • Owner — Determines the parent of the VDialog message window.
  • Content, ContentLinks, WindowTitle and MainInstruction — Determines the content of the dialog window which will be displayed, the caption of the window, and the main instruction.
  • Buttons — Determines what buttons will be displayed on the VDialog message window. VDialogButton is a class containing UseCustomText, Text and VDialogResult properties, and also a Click event which is raised when the associated button is clicked (but before closing the window).
  • MainIcon, CustomMainIcon — The image shown at the left side of the window (or right side when right-to-left layout is used).
  • DefaultButton — Determines which button is initially focused.
  • RightToLeft and RightToLeftLayout — Determines whether the layout of the window should be "mirrored".
  • Result — Indicates the return value of the VDialog window.
  • LockSystem — Enables the UAC-like system locking behavior.
  • CustomControl — Provides an easy way to extend the VDialog window. It can be used to emulate the features of TaskDialog which are not supported yet.
  • VerificationText and VerificationFlagChecked — Manages the check box shown at the left side of the buttons. It can be used for "Don't show it again"-like check boxes.
  • Sound — Played when the dialog window is shown.
  • FooterText, FooterLinks, FooterIcon and CustomFooterIcon — Determines the text and the image of the footer.
  • ExpandedInformation, ExpandedInformationLinks, ExpandFooterArea, ExpandedByDefault, ExpandedControlText and CollapsedControlText — determines the look and behavior of the expand control and label with extra information.

Localization Support

The captions of the standard buttons (e.g. OK, Yes, Ignore, etc.) can be easily localized by translating the resources file. The English versions of these captions are contained in the Resources.resx file.


The VDialogIcon class contains twelve read-only fields which provide access to Vista-like images, such as:

  • InformationInformation
  • QuestionQuestion
  • WarningWarning
  • ErrorError
  • SecurityShieldSecurityShield, SecurityShieldBlue, SecurityShieldGray
  • SecuritySuccessSecuritySuccess
  • SecurityQuestionSecurityQuestion
  • SecurityWarningSecurityWarning
  • SecurityErrorSecurityError
  • There is also the None field.

Assigning the VDialogIcon.Security* field (except the SecurityShield) to the MainIcon property of the VDialog class causes the appropriate gradient to be drawn beneath the icon and main instruction.


The VDialogSound class provides access to six sounds (Default, Information, Question, Warning, Error, Security) that can be assigned to the Sound property of the VDialog class. Custom sound can be provided by an object which implements the ISound interface.

Command Links

There is an animated CommandLink control which can be used to build a custom control and then embed it in the VDialog.

Screenshot 5 - Command links


Although the VDialog class provides many useful properties, there are some features of TaskDialog that my VDialog does not implement yet, such as:

  • Full support for CommandLinks
  • RadioButtons
  • ProgressBar
  • Timer

These features can only be obtained by using custom controls.


  • 1.5 (15.10.2008) — Important! This is the last “standalone” version of the control. The next version is included in a new project hosted at CodePlex.
    • Parent window no longer loses focus in certain situations on Windows Vista
    • Added HotForeColor property to the CommandLink control
    • Added German localization (I would be grateful if someone checked it with German Windows Vista)
    • Fixed some bugs
  • 1.4 (02.01.2008)
    • Added support for Links
    • Fixed some bugs
  • 1.3 (12.12.2007)
    • Added partial support for CommandLinks
    • Added support for elevation (shield) icon
    • Fixed some bugs
  • 1.2 (05.12.2007)
    • Added XML documentation
    • Added Close method to the VDialog class
    • Added license
    • Minor bugs fixed
  • 1.1 (18.11.2007)
    • Renamed some properties so they are compliant with TaskDialog
    • Added sounds support
    • Added footer support
    • Added expandable information support
    • Added support for security dialogs
    • Minor bugs fixed
  • 1.0
    • 11.11.2007 — Added Vista-like images
    • 07.11.2007 — First version


This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)


About the Author

Lukasz Swiatkowski
Software Developer
Poland Poland
I am a graduate of Wroclaw University of Technology, Poland.

My interests: reading, programming, drawing, Japan, yoga, tai-chi.

My websites:,

You may also be interested in...

Comments and Discussions

Generaljust for your information Pin
dwegmann21-Feb-08 13:05
memberdwegmann21-Feb-08 13:05 
GeneralRe: just for your information Pin
Lukasz Swiatkowski21-Feb-08 13:31
mvpLukasz Swiatkowski21-Feb-08 13:31 
Generaluse of your library in a commercial program. Pin
Angel T17-Feb-08 12:17
memberAngel T17-Feb-08 12:17 
GeneralRe: use of your library in a commercial program. Pin
Lukasz Swiatkowski21-Feb-08 13:16
mvpLukasz Swiatkowski21-Feb-08 13:16 
QuestionRe: use of your library in a commercial program. Pin
PaulGuenette18-Nov-08 19:03
memberPaulGuenette18-Nov-08 19:03 
AnswerRe: use of your library in a commercial program. Pin
Lukasz Swiatkowski19-Nov-08 2:27
mvpLukasz Swiatkowski19-Nov-08 2:27 
GeneralRe: use of your library in a commercial program. Pin
PaulGuenette19-Nov-08 11:59
memberPaulGuenette19-Nov-08 11:59 
GeneralRe: use of your library in a commercial program. Pin
Lukasz Swiatkowski19-Nov-08 14:22
mvpLukasz Swiatkowski19-Nov-08 14:22 
Yes, that’s right.

1. Yes. I intend to translate the code to C# and maybe later I'll work only on C# version (I'm not sure yet). But currently I have been working on WPF version of the TaskDialog which already has all the features that VDialog has, and additionally it has full support for CommandLinks, RadioButtons, ProgressBar and timer. I intend to improve also the VDialog (TODO items).
2. There is an appropriate link on my website to make donations (using PayPal).


My website:

GeneralRe: use of your library in a commercial program. Pin
PaulGuenette19-Nov-08 14:36
memberPaulGuenette19-Nov-08 14:36 
GeneralRe: use of your library in a commercial program. Pin
Lukasz Swiatkowski19-Nov-08 14:39
mvpLukasz Swiatkowski19-Nov-08 14:39 
GeneralDialog resizes when displayed Pin
BryanKinkel29-Jan-08 6:07
memberBryanKinkel29-Jan-08 6:07 
GeneralRe: Dialog resizes when displayed Pin
Lukasz Swiatkowski21-Feb-08 13:20
mvpLukasz Swiatkowski21-Feb-08 13:20 
QuestionVery Nice Library! Pin
BryanKinkel24-Jan-08 4:57
memberBryanKinkel24-Jan-08 4:57 
GeneralRe: Very Nice Library! Pin
Lukasz Swiatkowski24-Jan-08 6:26
mvpLukasz Swiatkowski24-Jan-08 6:26 
Generalmaking in centerscreen... Pin
TheCardinal9-Jan-08 22:03
memberTheCardinal9-Jan-08 22:03 
GeneralRe: making in centerscreen... Pin
Lukasz Swiatkowski10-Jan-08 8:04
mvpLukasz Swiatkowski10-Jan-08 8:04 
GeneralCenterParent when LockSystem Pin
marcos n8-Jan-08 7:50
membermarcos n8-Jan-08 7:50 
GeneralRe: CenterParent when LockSystem Pin
Lukasz Swiatkowski8-Jan-08 9:41
mvpLukasz Swiatkowski8-Jan-08 9:41 
GeneralRe: CenterParent when LockSystem [modified] Pin
marcos n8-Jan-08 23:16
membermarcos n8-Jan-08 23:16 
GeneralRe: CenterParent when LockSystem Pin
Lukasz Swiatkowski9-Jan-08 13:06
mvpLukasz Swiatkowski9-Jan-08 13:06 
JokeRe: CenterParent when LockSystem Pin
marcos n10-Jan-08 4:29
membermarcos n10-Jan-08 4:29 
GeneralRe: CenterParent when LockSystem Pin
Lukasz Swiatkowski10-Jan-08 7:59
mvpLukasz Swiatkowski10-Jan-08 7:59 
GeneralNice work Pin
GlimmerMan8-Jan-08 4:18
memberGlimmerMan8-Jan-08 4:18 
GeneralRe: Nice work Pin
Lukasz Swiatkowski8-Jan-08 9:34
mvpLukasz Swiatkowski8-Jan-08 9:34 
QuestionIs there any chance of a port of this to (unmanaged i.e. native) C++? Pin
Mike Diack3-Jan-08 0:47
memberMike Diack3-Jan-08 0:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.171114.1 | Last Updated 27 Mar 2013
Article Copyright 2007 by Lukasz Swiatkowski
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid