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

Introduction

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.:

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.

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.

Sounds

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.

TODO

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.

History

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.

Comments and Discussions

Hey, this is an amazing little tool! I would love to see just a totally commented version of the system-locking feature. I need that for my application, but when I try doing it, it just totally locks up the computer with the unlock form frozen. I just need to lock the system, and when the user enters a correct password, call a method to unlock the computer. Thanks again for this awesome software!Bobert

dear lukaszi would like to use this very nice vdialog package instead of the message box. i downloaded and opened the zip but don't know howto tell the program where to look for vdialog. how do i include this object in the vb program ?sorry for such a newbie question thanksdavid de leeuw

Hi Lukasz, I am a big fan of your PopUp project. Just came over this project and have a question:

I would like to apply the LockSystem feature only to the application. So, I would like to lock the MainForm of my application while I do some processing, not the whole desktop-enviroment.Of course, I can lock my MainForm by e.g. ignoring any input. But I would like to have ONLY my MainForm visible in that grey-ish look, as it looks way nicer!!

Is this possible?

Cheers,Daniel

btw: I understand that this is not what `LockSystem` has in mind. Maybe my idea should be called `LockApplication`

Hi!Thank you for VDialog. It's a really useful lib.With this I just want to let you know that there is a problem if Windows is missing a system sound file. soundPath ind VDialogSound.vb line 38 will be empty in this case and it will raise an ArgumentException. You are already catching this exception but I find that you should avoid this exception being thrown.Kind regards

My understanding of the CPL is that it enforces 'copyleft', meaning that anyone who uses this source code, modified or not, in their own project must make the full source code of their project available. Is this not the case?

It looks like you can link to a CPL project (i.e., this library) without triggering this requirement, which helps, but at the very least, you'd have to split a proprietary project into the 'closed' and 'open' code bases, compile these into their own respective binaries, and make the source code the for 'open' code base available. Do I have this right?

If so, would you consider providing (or selling) this code under a more permissive license (such as MS-PL, CC Attribution, or Code Project Open License)?

Fair enough. So you only require fixes/extensions to your code to be released, not the full source code of any application that uses code you've written, regardless of how your code is incorporated, right?

In that case, I'll likely make use of it, in which case I have two further questions:1. Is there an area you'd like me to improve upon (such as the TODO items you mentioned)?2. Where can I send an (eventual, possible) donation?

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).

I'm still playing around a bit with the library and noticed some resizing going on just as the form is displayed.

For example, in the demo app, if you click "Show standard TaskDialog-like window", the vDialog form initially displays a couple of pixels longer than it should be. Then the height adjusts itself to fit the contents and the inner controls are painted.

Any idea what is going on? Any ideas how to have the height set correctly before the dialog displays?