Click here to Skip to main content
Email Password   helpLost your password?

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

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

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()
    .Show()
End With

Features

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:

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.

Images

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

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.

Screenshot 5 - Command links

TODO

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

These features can only be obtained by using custom controls.

History

You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
RantNice work, C# VDialogTest attached
craigwmiller
8:34 20 Aug '09  
Yes, I'm still using .NET 2.0 - but want the UI of WPF/.NET 3.5, your work is helping me get there!

Thumbs UpThanks

BTW: the code listing below is a C# version of the DialogTest, code conversion was done with the help of [^]

~~~~~~~~~~~~~~~~~~~~~~~
C# VDialogTest Implementation Steps
1. create new Windows Form project
2. add references
2.1 Microsoft.VisualBasic
2.2 VDialog
3. add MyCustomControl usercontrol
4. update files with the code listed below
4.1 Form1.cs
4.2 Form1.Designer.cs
4.3 MyCustomControl.Designer.cs
~~~~~~~~~~~~~~~~~~~~~~~

==============
4.1 File: Form1.cs
==============
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using LukeSw.Windows.Forms;
using Microsoft.VisualBasic; //Constants

namespace Csharp.VDialogTest {
public partial class Form1: Form {
public Form1() {
// This call is required by the Windows Form Designer.
InitializeComponent();

// Add any initialization after the InitializeComponent() call.
CheckForIllegalCrossThreadCalls=true;
}

private static void dddd1() {
VDialog.Show( null, "d1 This is a standard MessageBox-like window.", "Window Caption" );
}
private void dddd2() {
VDialog.Show( this, "d2 This is a standard MessageBox-like window.", "Window Caption" );
}
private void CommandLink1_Click( object sender, EventArgs e ) {
VDialog.Show(
this,
"This is a standard MessageBox-like window.",
"Window Caption" );
//SystemLocker.LockedInvoke(New System.Threading.ThreadStart(AddressOf dddd1))
//VDialog.Show(Me, "2his is a standard MessageBox-like window.", "Window Caption")
//SystemLocker.LockedInvoke(New System.Threading.ThreadStart(AddressOf dddd2))
//VDialog.Show(Me, "3his is a standard MessageBox-like window.", "Window Caption")
}

private void CommandLink2_Click( object sender, EventArgs e ) {
VDialog.Show(
this,
"Hello World!",
"Caption",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question,
MessageBoxDefaultButton.Button2 );
}

private void CommandLink3_Click( object sender, EventArgs e ) {
VDialog vd=new VDialog();
{
vd.Owner=this;
vd.WindowTitle="WindowTitle";
vd.MainInstruction="Main instruction";
vd.Content="Content";
vd.MainIcon=VDialogIcon.Warning;
vd.Buttons=new VDialogButton[] { new VDialogButton( VDialogResult.OK ) };
vd.Show();
}
}

private void CommandLink4_Click( object sender, EventArgs e ) {
{
VDialog vd=new VDialog();
{
vd.Owner=this;
vd.WindowTitle="Some window";
vd.MainInstruction="Please do something";
vd.CustomMainIcon=Icon.ToBitmap();
vd.Buttons=new VDialogButton[] {
new VDialogButton(VDialogResult.Ignore),
new VDialogButton(VDialogResult.Continue),
new VDialogButton(">> Click Me <<", Button_Click, true),
new VDialogButton(VDialogResult.Cancel) };
vd.DefaultButton=VDialogDefaultButton.None;
vd.Sound=VDialogSound.Security;
vd.VerificationText="Check me";
vd.Show();
}
}
}

private void CommandLink5_Click( object sender, EventArgs e ) {

VDialog vd=new VDialog(); {
vd.Owner=null;
vd.Buttons=new VDialogButton[] { new VDialogButton( VDialogResult.OK ) };
vd.Content="Please close this window.";
vd.MainIcon=VDialogIcon.SecuritySuccess;
vd.MainInstruction="SecuritySuccess";
vd.WindowTitle="Security Dialog (1/7)";
vd.Show();
vd.MainIcon=VDialogIcon.SecurityQuestion;
vd.MainInstruction="SecurityQuestion";
vd.WindowTitle="Security Dialog (2/7)";
vd.Show();
vd.MainIcon=VDialogIcon.SecurityWarning;
vd.MainInstruction="SecurityWarning";
vd.WindowTitle="Security Dialog (3/7)";
vd.Show();
vd.MainIcon=VDialogIcon.SecurityError;
vd.MainInstruction="SecurityError";
vd.WindowTitle="Security Dialog (4/7)";
vd.Show();
vd.MainIcon=VDialogIcon.SecurityShield;
vd.MainInstruction="SecurityShield";
vd.WindowTitle="Security Dialog (5/7)";
vd.Show();
vd.MainIcon=VDialogIcon.SecurityShieldBlue;
vd.MainInstruction="SecurityShieldBlue";
vd.WindowTitle="Security Dialog (6/7)";
vd.Show();
vd.MainIcon=VDialogIcon.SecurityShieldGray;
vd.MainInstruction="SecurityShieldGray";
vd.WindowTitle="Security Dialog (7/7)";
vd.Show();
}

}

private void CommandLink6_Click( object sender, EventArgs e ) {

VDialog vd=new VDialog(); {
vd.LinkClicked+=linkClicked;
vd.Owner=this;
vd.Buttons=new VDialogButton[] { new VDialogButton( VDialogResult.OK ) };
vd.WindowTitle="Another Example";
vd.MainInstruction="Expandable Dialog";
vd.MainIcon=VDialogIcon.Information;
vd.Content=
"In this example you can see that there is an additional"
+Constants.vbCrLf
+"footer and some expandable extra information.";
vd.ContentLinks.Add( vd.Content.IndexOf( "footer" ), 6 );
vd.ContentLinks[0].Name="Content";
vd.FooterIcon=VDialogIcon.Information;
vd.FooterText="This is the footer. You can click here.";
vd.FooterLinks.Add( vd.FooterText.IndexOf( "here" ), 4 );
vd.FooterLinks[0].Name="Footer";
vd.ExpandedControlText="Hide Extra Info";
vd.CollapsedControlText="Show Extra Info";
vd.ExpandedInformation="Extra Information";
vd.ExpandedInformationLinks.Add( vd.ExpandedInformation.IndexOf( "Information" ), 11 );
vd.ExpandedInformationLinks[0].Name="ExpandedInformation";
vd.ExpandFooterArea=true;
vd.ExpandedByDefault=true;
vd.Show();
vd.RightToLeft=System.Windows.Forms.RightToLeft.Yes;
vd.RightToLeftLayout=true;
vd.ExpandedByDefault=false;
vd.ExpandFooterArea=false;
vd.Show();
}
}

private void CommandLink7_Click( object sender, EventArgs e ) {

VDialog vd=new VDialog(); {
vd.Owner=this;
vd.WindowTitle="UAC-like window";
vd.MainInstruction="You must click OK button to continue";
vd.Buttons=new VDialogButton[] { new VDialogButton( VDialogResult.OK ), new VDialogButton( VDialogResult.Cancel ) };
vd.MainIcon=VDialogIcon.SecurityShieldBlue;
vd.DefaultButton=VDialogDefaultButton.None;
vd.Content="If you don't know what to do, click Cancel button.";
vd.LockSystem=true;
vd.CustomControl=new MyCustomControl();
vd.Show();
}

}

private void linkClicked(
object sender,
System.Windows.Forms.LinkLabelLinkClickedEventArgs e ) {
VDialog.Show(
(IWin32Window)sender,
"You've clicked the link from the "
+e.Link.Name
+" label." );
}

private void Button_Click(
System.Object sender,
System.EventArgs e ) {
{
((Button)sender).Text="Thank you!";
((Button)sender).Image=null;
((Button)sender).Enabled=false;
}
}

private void ButtonClose_Click(
System.Object sender,
System.EventArgs e) {
Close();
}

}

}


==============
4.2 File:Form1.Designer.cs
==============
namespace Csharp.VDialogTest {
partial class Form1 {
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components=null;

/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose( bool disposing ) {
if(disposing&&(components!=null)) {
components.Dispose();
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
this.LabelTitle=new System.Windows.Forms.Label();
this.Panel1=new System.Windows.Forms.Panel();
this.ButtonClose=new System.Windows.Forms.Button();
this.LabelBevel=new System.Windows.Forms.Label();
this.CommandLink7=new LukeSw.Windows.Forms.CommandLink();
this.CommandLink6=new LukeSw.Windows.Forms.CommandLink();
this.CommandLink5=new LukeSw.Windows.Forms.CommandLink();
this.CommandLink4=new LukeSw.Windows.Forms.CommandLink();
this.CommandLink3=new LukeSw.Windows.Forms.CommandLink();
this.CommandLink2=new LukeSw.Windows.Forms.CommandLink();
this.CommandLink1=new LukeSw.Windows.Forms.CommandLink();
this.Panel1.SuspendLayout();
this.SuspendLayout();
//
// LabelTitle
//
this.LabelTitle.Anchor=((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top|System.Windows.Forms.AnchorStyles.Bottom)
|System.Windows.Forms.AnchorStyles.Left)));
this.LabelTitle.AutoSize=true;
this.LabelTitle.BackColor=System.Drawing.Color.Transparent;
this.LabelTitle.Font=new System.Drawing.Font( "Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)) );
this.LabelTitle.ForeColor=System.Drawing.SystemColors.HotTrack;
this.LabelTitle.Location=new System.Drawing.Point( 11, 13 );
this.LabelTitle.Margin=new System.Windows.Forms.Padding( 9, 16, 16, 16 );
this.LabelTitle.Name="LabelTitle";
this.LabelTitle.Size=new System.Drawing.Size( 292, 19 );
this.LabelTitle.TabIndex=10;
this.LabelTitle.Text="Choose a modal dialog window to show";
//
// Panel1
//
this.Panel1.BackColor=System.Drawing.SystemColors.Control;
this.Panel1.Controls.Add( this.ButtonClose );
this.Panel1.Dock=System.Windows.Forms.DockStyle.Bottom;
this.Panel1.Location=new System.Drawing.Point( 0, 360 );
this.Panel1.Name="Panel1";
this.Panel1.Size=new System.Drawing.Size( 390, 48 );
this.Panel1.TabIndex=18;
//
// ButtonClose
//
this.ButtonClose.Anchor=((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top|System.Windows.Forms.AnchorStyles.Right)));
this.ButtonClose.DialogResult=System.Windows.Forms.DialogResult.Cancel;
this.ButtonClose.Location=new System.Drawing.Point( 303, 12 );
this.ButtonClose.Margin=new System.Windows.Forms.Padding( 12 );
this.ButtonClose.Name="ButtonClose";
this.ButtonClose.Size=new System.Drawing.Size( 75, 23 );
this.ButtonClose.TabIndex=0;
this.ButtonClose.Text="Close";
this.ButtonClose.UseVisualStyleBackColor=true;
this.ButtonClose.Click+=new System.EventHandler( this.ButtonClose_Click );
//
// LabelBevel
//
this.LabelBevel.BorderStyle=System.Windows.Forms.BorderStyle.Fixed3D;
this.LabelBevel.Dock=System.Windows.Forms.DockStyle.Bottom;
this.LabelBevel.Location=new System.Drawing.Point( 0, 358 );
this.LabelBevel.Name="LabelBevel";
this.LabelBevel.Size=new System.Drawing.Size( 390, 2 );
this.LabelBevel.TabIndex=19;
//
// CommandLink7
//
this.CommandLink7.Location=new System.Drawing.Point( 40, 297 );
this.CommandLink7.Margin=new System.Windows.Forms.Padding( 3, 0, 3, 0 );
this.CommandLink7.Name="CommandLink7";
this.CommandLink7.ShowElevationIcon=true;
this.CommandLink7.Size=new System.Drawing.Size( 341, 41 );
this.CommandLink7.TabIndex=17;
this.CommandLink7.Text="Show system-locking TaskDialog-like window";
this.CommandLink7.Click+=new System.EventHandler( this.CommandLink7_Click );
//
// CommandLink6
//
this.CommandLink6.Location=new System.Drawing.Point( 40, 256 );
this.CommandLink6.Margin=new System.Windows.Forms.Padding( 3, 0, 3, 0 );
this.CommandLink6.Name="CommandLink6";
this.CommandLink6.Size=new System.Drawing.Size( 341, 41 );
this.CommandLink6.TabIndex=16;
this.CommandLink6.Text="Show expandable TaskDialog-like window";
this.CommandLink6.Click+=new System.EventHandler( this.CommandLink6_Click );
//
// CommandLink5
//
this.CommandLink5.Location=new System.Drawing.Point( 40, 215 );
this.CommandLink5.Margin=new System.Windows.Forms.Padding( 3, 0, 3, 0 );
this.CommandLink5.Name="CommandLink5";
this.CommandLink5.Size=new System.Drawing.Size( 341, 41 );
this.CommandLink5.TabIndex=15;
this.CommandLink5.Text="Show security TaskDialog-like windows";
this.CommandLink5.Click+=new System.EventHandler( this.CommandLink5_Click );
//
// CommandLink4
//
this.CommandLink4.Location=new System.Drawing.Point( 40, 174 );
this.CommandLink4.Margin=new System.Windows.Forms.Padding( 3, 0, 3, 0 );
this.CommandLink4.Name="CommandLink4";
this.CommandLink4.Size=new System.Drawing.Size( 341, 41 );
this.CommandLink4.TabIndex=14;
this.CommandLink4.Text="Show customized TaskDialog-like window";
this.CommandLink4.Click+=new System.EventHandler( this.CommandLink4_Click );
//
// CommandLink3
//
this.CommandLink3.Location=new System.Drawing.Point( 40, 133 );
this.CommandLink3.Margin=new System.Windows.Forms.Padding( 3, 0, 3, 0 );
this.CommandLink3.Name="CommandLink3";
this.CommandLink3.Size=new System.Drawing.Size( 341, 41 );
this.CommandLink3.TabIndex=13;
this.CommandLink3.Text="Show standard TaskDialog-like window";
this.CommandLink3.Click+=new System.EventHandler( this.CommandLink3_Click );
//
// CommandLink2
//
this.CommandLink2.Location=new System.Drawing.Point( 40, 92 );
this.CommandLink2.Margin=new System.Windows.Forms.Padding( 3, 0, 3, 0 );
this.CommandLink2.Name="CommandLink2";
this.CommandLink2.Size=new System.Drawing.Size( 341, 41 );
this.CommandLink2.TabIndex=12;
this.CommandLink2.Text="Show customized MessageBox-like window";
this.CommandLink2.Click+=new System.EventHandler( this.CommandLink2_Click );
//
// CommandLink1
//
this.CommandLink1.Location=new System.Drawing.Point( 40, 51 );
this.CommandLink1.Margin=new System.Windows.Forms.Padding( 3, 3, 3, 0 );
this.CommandLink1.Name="CommandLink1";
this.CommandLink1.Size=new System.Drawing.Size( 341, 41 );
this.CommandLink1.TabIndex=11;
this.CommandLink1.Text="Show standard MessageBox-like window";
this.CommandLink1.Click+=new System.EventHandler( this.CommandLink1_Click );
//
// Form1
//
this.AutoScaleDimensions=new System.Drawing.SizeF( 6F, 13F );
this.AutoScaleMode=System.Windows.Forms.AutoScaleMode.Font;
this.BackColor=System.Drawing.Color.White;
this.ClientSize=new System.Drawing.Size( 390, 408 );
this.Controls.Add( this.LabelBevel );
this.Controls.Add( this.Panel1 );
this.Controls.Add( this.LabelTitle );
this.Controls.Add( this.CommandLink7 );
this.Controls.Add( this.CommandLink6 );
this.Controls.Add( this.CommandLink5 );
this.Controls.Add( this.CommandLink4 );
this.Controls.Add( this.CommandLink3 );
this.Controls.Add( this.CommandLink2 );
this.Controls.Add( this.CommandLink1 );
this.Name="Form1";
this.Text="VDialog Samples";
this.Panel1.ResumeLayout( false );
this.ResumeLayout( false );
this.PerformLayout();

}

#endregion

internal System.Windows.Forms.Label LabelTitle;
internal System.Windows.Forms.Panel Panel1;
internal System.Windows.Forms.Button ButtonClose;
internal System.Windows.Forms.Label LabelBevel;
internal LukeSw.Windows.Forms.CommandLink CommandLink7;
internal LukeSw.Windows.Forms.CommandLink CommandLink6;
internal LukeSw.Windows.Forms.CommandLink CommandLink5;
internal LukeSw.Windows.Forms.CommandLink CommandLink4;
internal LukeSw.Windows.Forms.CommandLink CommandLink3;
internal LukeSw.Windows.Forms.CommandLink CommandLink2;
internal LukeSw.Windows.Forms.CommandLink CommandLink1;
}
}


==============
4.3 File:MyCustomControl.Designer.cs
==============
namespace Csharp.VDialogTest {
partial class MyCustomControl {
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components=null;

/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose( bool disposing ) {
if(disposing&&(components!=null)) {
components.Dispose();
}
base.Dispose( disposing );
}

#region Component Designer generated code

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
components=new System.ComponentModel.Container();
this.AutoScaleMode=System.Windows.Forms.AutoScaleMode.Font;

this.RadioButton1=new System.Windows.Forms.RadioButton();
this.RadioButton2=new System.Windows.Forms.RadioButton();
this.RadioButton3=new System.Windows.Forms.RadioButton();
this.ProgressBar1=new System.Windows.Forms.ProgressBar();
this.CommandLink1=new LukeSw.Windows.Forms.CommandLink();
this.CommandLink2=new LukeSw.Windows.Forms.CommandLink();
this.SuspendLayout();
//
//RadioButton1
//
this.RadioButton1.Dock=System.Windows.Forms.DockStyle.Top;
this.RadioButton1.Location=new System.Drawing.Point( 0, 0 );
this.RadioButton1.Name="RadioButton1";
this.RadioButton1.Size=new System.Drawing.Size( 154, 20 );
this.RadioButton1.TabIndex=0;
this.RadioButton1.TabStop=true;
this.RadioButton1.Text="RadioButton1";
this.RadioButton1.UseVisualStyleBackColor=true;
//
//RadioButton2
//
this.RadioButton2.Dock=System.Windows.Forms.DockStyle.Top;
this.RadioButton2.Location=new System.Drawing.Point( 0, 20 );
this.RadioButton2.Name="RadioButton2";
this.RadioButton2.Size=new System.Drawing.Size( 154, 20 );
this.RadioButton2.TabIndex=1;
this.RadioButton2.TabStop=true;
this.RadioButton2.Text="RadioButton2";
this.RadioButton2.UseVisualStyleBackColor=true;
//
//RadioButton3
//
this.RadioButton3.CheckAlign=System.Drawing.ContentAlignment.TopLeft;
this.RadioButton3.Dock=System.Windows.Forms.DockStyle.Top;
this.RadioButton3.Location=new System.Drawing.Point( 0, 40 );
this.RadioButton3.Name="RadioButton3";
this.RadioButton3.Size=new System.Drawing.Size( 154, 27 );
this.RadioButton3.TabIndex=2;
this.RadioButton3.TabStop=true;
this.RadioButton3.Text="RadioButton3";
this.RadioButton3.TextAlign=System.Drawing.ContentAlignment.TopLeft;
this.RadioButton3.UseVisualStyleBackColor=true;
//
//ProgressBar1
//
this.ProgressBar1.Dock=System.Windows.Forms.DockStyle.Top;
this.ProgressBar1.Location=new System.Drawing.Point( 0, 67 );
this.ProgressBar1.Name="ProgressBar1";
this.ProgressBar1.Size=new System.Drawing.Size( 154, 15 );
this.ProgressBar1.Style=System.Windows.Forms.ProgressBarStyle.Marquee;
this.ProgressBar1.TabIndex=3;
this.ProgressBar1.Value=50;
//
//CommandLink1
//
this.CommandLink1.Dock=System.Windows.Forms.DockStyle.Bottom;
this.CommandLink1.Location=new System.Drawing.Point( 0, 84 );
this.CommandLink1.Margin=new System.Windows.Forms.Padding( 3, 3, 3, 0 );
this.CommandLink1.Name="CommandLink1";
this.CommandLink1.Size=new System.Drawing.Size( 154, 41 );
this.CommandLink1.TabIndex=5;
this.CommandLink1.Text="CommandLink1";
//
//CommandLink2
//
this.CommandLink2.Dock=System.Windows.Forms.DockStyle.Bottom;
this.CommandLink2.Location=new System.Drawing.Point( 0, 125 );
this.CommandLink2.Margin=new System.Windows.Forms.Padding( 3, 0, 3, 3 );
this.CommandLink2.Name="CommandLink2";
this.CommandLink2.ShowElevationIcon=true;
this.CommandLink2.Size=new System.Drawing.Size( 154, 41 );
this.CommandLink2.TabIndex=5;
this.CommandLink2.Text="CommandLink2";
//
//MyCustomControl
//
this.AutoScaleDimensions=new System.Drawing.SizeF( 6f, 13f );
this.AutoScaleMode=System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize=true;
this.Controls.Add( this.ProgressBar1 );
this.Controls.Add( this.CommandLink1 );
this.Controls.Add( this.RadioButton3 );
this.Controls.Add( this.RadioButton2 );
this.Controls.Add( this.RadioButton1 );
this.Controls.Add( this.CommandLink2 );
this.Name="MyCustomControl";
this.Size=new System.Drawing.Size( 154, 166 );

this.ResumeLayout( false );

}

#endregion

internal System.Windows.Forms.RadioButton RadioButton1;
internal System.Windows.Forms.RadioButton RadioButton2;
internal System.Windows.Forms.RadioButton RadioButton3;
internal System.Windows.Forms.ProgressBar ProgressBar1;
internal LukeSw.Windows.Forms.CommandLink CommandLink1;
internal LukeSw.Windows.Forms.CommandLink CommandLink2;

}
}
Generalgood work
Donsw
15:25 26 Jan '09  
be better in c#, but still good work
QuestionSystem-Locking feature
bobert_smallgeek
12:46 29 Dec '08  
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. Poke tongue 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
GeneralC# Version
melnac
7:04 25 Dec '08  
Hi Lukasz,
when do you think a C# version is ready ?

Thanks in advance,
Giuseppe.
QuestionFallback on native API in Vista?
Serge Wautier
0:48 7 Oct '08  
Lukasz,
Outstanding job! Congrats.

One question: Does your class fallback on the native Vista API when running on Vista?

Serge.

http://www.apptranslator.com - Localization solution for your Visual C++ apps

AnswerRe: Fallback on native API in Vista?
Lukasz Swiatkowski
8:58 7 Oct '08  
Thank you Smile

No, it doesn't, because VDialog has functionality which is absent in native TaskDialog, e.g. providing custom sound or embedding custom controls.

Łukasz

~~~~~~~~~~~~~~~~~~~
My website: www.lukesw.net

GeneralBug
Julian-w
9:17 19 May '08  
Hello,
I get a error when I but a CommandLink at a Form and minimize that Form.

My Site: julian-w.de

(Sorry for my bad English, I'm from Germany)

Generalvdialog usage
Member 4347534
2:26 16 Apr '08  
dear lukasz
i would like to use this very nice vdialog package instead of the
message box. i downloaded and opened the zip but don't know how
to tell the program where to look for vdialog. how do i include
this object in the vb program ?
sorry for such a newbie question Smile Red faced
thanks
david de leeuw
GeneralRe: vdialog usage
Lukasz Swiatkowski
11:48 17 Apr '08  
Hi,

Open your project's properties and add VDialog.dll to the references. That's all Smile
Alternatively you can add all VDialog source files into your project using "Add existing item" command from menu bar.

Regards,
Lukasz

~~~~~~~~~~~~~~~~~~~
My website: www.lukesw.net

GeneralRe: vdialog usage
Member 4347534
2:13 4 May '08  
Hi Lukasz
I tried referencing the dll but it didn't work. Finally I found the
"Imports LukeSw.Windows.Forms" to be included in the main program.
Now it runs!
Thanks
David
GeneralRe: vdialog usage
Lukasz Swiatkowski
7:49 4 May '08  
You're welcome Smile

~~~~~~~~~~~~~~~~~~~
My website: www.lukesw.net

QuestionCan't run the sample button 'Show system-locking TaskDialog-like window'
Member 3711703
2:10 15 Apr '08  
Hi,

just tried your sample and when I click on the last button the code only runs until it reaches the code line

newThread.Join()

in the function LockSystemAndShow.

I get an error sound, but no error message at all.

My system runs as a standard user under XP SP2, but the same error appears when i run the app with RunAs and an administrator user.

Regards,

Michael
GeneralRe: Can't run the sample button 'Show system-locking TaskDialog-like window'
Lukasz Swiatkowski
11:44 17 Apr '08  
Hi,

How do you know which line does it reach? I hope you didn't debug it. To debug it one must disable desktop switching in code, because it blocks Visual Studio and Windows.

If you encounter this bug running sample not from VS, then maybe it's bug in .NET Framework. I've checked this sample on various computers/configurations, and it always have worked.

Regards,
Lukasz

~~~~~~~~~~~~~~~~~~~
My website: www.lukesw.net

GeneralRe: Can't run the sample button 'Show system-locking TaskDialog-like window' [modified]
Member 3711703
1:23 18 Apr '08  
Yes, I tried to find the line of code by debugging in VS, but I get an error when I run the compiled code from the bin folder, too. How can I find out what the problem is?

I played around a little and uncommented the lines doing the desktop switching. Now the (compiled) application runs fine. So the error must have something to do with the desktop switching.

modified on Friday, April 18, 2008 7:11 AM

GeneralRe: Can't run the sample button 'Show system-locking TaskDialog-like window'
Lukasz Swiatkowski
6:38 18 Apr '08  
Strange. Desktop switching should not cause any problems. Do you have all updates applied to Windows and .NET 2.0 with SP1 installed?

Lukasz

~~~~~~~~~~~~~~~~~~~
My website: www.lukesw.net

GeneralScreen center
Pndm
1:20 11 Apr '08  
Nice work, i loved your control.

I think i found a bug. If we give the window a big message string, the form doesn't center itself, it get's too big on the right side of the screen.

Btw, do you mind if i use it in some of my applications?

Since my native language isn't english please forgive my gramar errors. ^_^
^º-º^ OddSignature ^º-º^

GeneralRe: Screen center
Lukasz Swiatkowski
11:39 17 Apr '08  
Thanks.

I'll check this bug as soon as I have time. Now I'm working on master thesis.

You can use it in any application (free and commercial). See the license.
You only cannot include it in controls/components packs or libraries.

Lukasz

~~~~~~~~~~~~~~~~~~~
My website: www.lukesw.net

QuestionTimer for autoclose with default button [modified]
Peni
5:22 8 Apr '08  
Is possible add it?

Great work Smile

Sorry for my english i'm spanish

My code:

#Region " TaskDialog "
' PENI
Private _TimerValue As Integer
Public Property TimerValue() As Integer
Get
Return _TimerValue
End Get
Set(ByVal value As Integer)
_TimerValue = value
End Set
End Property
Private MiTimerCount As Integer = 0
Private MiTimer As System.Windows.Forms.Timer
Private Sub MiTimer_Tick(ByVal sender As Object, ByVal e As EventArgs)
MiTimerCount += 1
_vdf.Text = Me.WindowTitle & " " & (_TimerValue - MiTimerCount).ToString
If MiTimerCount >= _TimerValue Then
MiTimer.Stop()
Me.Close(VDialogResult.None)
_vdf.Close()
End If
End Sub
' ---------------------------------------------------------------------------
.
.
.

In ShowInternal function:

' PENI
If _TimerValue <> 0 Then
MiTimer = New System.Windows.Forms.Timer
AddHandler MiTimer.Tick, AddressOf MiTimer_Tick
MiTimer.Interval = 1000 ' Chequea cada segundo
_vdf.Text = Me.WindowTitle & " " & _TimerValue.ToString
MiTimer.Enabled = True
MiTimer.Start()
End If
' ---------------------------------------------------------

vdf.ShowDialog(Owner)

modified on Tuesday, April 8, 2008 11:28 AM

GeneralRe: Timer for autoclose with default button
Lukasz Swiatkowski
4:14 9 Apr '08  
Hi,

I am planning to add a timer to the VDialog, but not exactly in this manner. I am planning to add full control over the VDialog window while it is shown, and then I will be able to add the timer.

Regards,
Lukasz

~~~~~~~~~~~~~~~~~~~
My website: www.lukesw.net

GeneralRe: Timer for autoclose with default button
Peni
4:25 9 Apr '08  
Ok. Thanks for your great job Smile
GeneralRe: Timer for autoclose with default button
Lukasz Swiatkowski
4:33 9 Apr '08  
You're welcome.

~~~~~~~~~~~~~~~~~~~
My website: www.lukesw.net

GeneralVista UI
pranav95
22:32 6 Apr '08  
THANK YOU

THIS IS REALLY GOOD
GeneralRe: Vista UI
Lukasz Swiatkowski
14:02 7 Apr '08  
You're welcome Smile

~~~~~~~~~~~~~~~~~~~
My website: www.lukesw.net

QuestionLockSystem @ Mainform possible? (not the whole system)
Daniël Trommel
21:09 3 Mar '08  
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`
GeneralRe: LockSystem @ Mainform possible? (not the whole system)
Lukasz Swiatkowski
17:04 11 Mar '08  
Hi,

Thanks, I'm glad you like it Smile

It is possible, but it'd require to write that functionality from scratch. And I think it's more difficult than whole-system-locking.

Regards,
Lukasz

~~~~~~~~~~~~~~~~~~~
My website: www.lukesw.net


Last Updated 14 Oct 2008 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2010