|
|
 Prize winner in Competition
"Best VB.NET article of November 2007"
Comments and Discussions
|
|
 |

|
off late a nice one, I have seen, ofcourse,Thanks
|
|
|
|
|

|
I have this strange bug, if i use a custom control and a RightToLeftLayout, the layout does not flip inside the custom control, even that the VDialog flips OK.
Any help will be highly appreciated.
(2B)||(!2B)
|
|
|
|

|
if i am to use the click event of the VButton, how can i cancel the click?
it seems that the click event uses the Button class when is not public.
(2B)||(!2B)
|
|
|
|

|
Yes, I'm still using .NET 2.0 - but want the UI of WPF/.NET 3.5, your work is helping me get there!
Thanks
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;
}
}
|
|
|
|

|
be better in c#, but still good work
|
|
|
|

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

|
Hi Lukasz,
when do you think a C# version is ready ?
Thanks in advance,
Giuseppe.
|
|
|
|

|
Lukasz,
Outstanding job! Congrats.
One question: Does your class fallback on the native Vista API when running on Vista?
|
|
|
|

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

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

|
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 ^º-º^
|
|
|
|

|
Is possible add it?
Great work
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
|
|
|
|

|
THANK YOU
THIS IS REALLY GOOD
|
|
|
|

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

|
Hello,
i would like to ask if i can use this library in my commercial product.
Is CPL license ok with this?
Do i have to include the source of vdialog in redistribution?
Thanks in advance
Angel T
|
|
|
|

|
Lukasz,
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?
-- Bryan
|
|
|
|

|
Lukasz,
I've been looking for something like this for a while and I'm interested in incorporating this into an established shareware product. Can I get permission to replace my MessageBox() calls with this?
Appropriate credit will be provided in About dialogs and other documentation. Contact me privately if you have any questions.
Bryan
|
|
|
|

|
how do you make the VDialog centerscreen if not using the .owner = me?
it seems that the VDialog is off center
can this be overriden?
thanks for this great control
-TheCardinal
|
|
|
|

|
Hi,
When LockSystem is set to true VDialog is centered on the screen not on its parent.
How can I get this?
Thanks,
|
|
|
|

|
Nicely done and thanks for posting the well done code.
Kevin S. Gallagher
Programming is an art form that fights back
|
|
|
|

|
This would be fabulous as a native Win32 C/C++ library - does anyone know of something similar or is anyone thinking of porting this to C++?
Mike
|
|
|
|

|
Hey Lucasz,
My main form is the form i'd like to use during LockDesktop, can it be done?
What if we made another form the primary form and simply spawned the 'main form' in new desktop from it?
Please let me know what you think, and a solution in code, please.
Thanks Lucasz.
~ Maaatt
|
|
|
|

|
Hi,
I am using the lock system function of this control to make a 'break forcer'. I was wondering, is it possible to shut the dialog 'remotely' (e.g. from the form that called it), seeing that the only button is to get out using a password? There are ways that I COULD get around that, but I would prefer that method if possible.
Thanks.
|
|
|
|

|
Hej!
I was struggling with a lock desktop functionality in my app. I do not want to show a form over, just lock the whole system for the time my app is doing database access.
Can you explain the shortest and quickest way to do this via Win32 API, please?
I need two (global) methods: one to Lock and another to UnLock.
Z gory wielkie dzieki,
pozdrawiam,
PL
/PL01
|
|
|
|

|
Is there a c# version of this?
|
|
|
|

|
Downloaded the source code because i wanted to see if i could make a Krypton Form
http://www.componentfactory.com/
I get an error in the designer
Could not find type 'LukeSw.Windows.Forms.Label'. Please make sure that the assembly that contains this type is referenced.
|
|
|
|

|
Hello,
Your codes lock whole desktop and create a new form, but how to lock desktop except the main form(Me)?
Thank you
|
|
|
|

|
Hi, really good library. As always!
One question though. Can I use it in comertial products?
|
|
|
|

|
Hello,
I want to lock desktop except the main form(Me) from the code below, how to do? Thank you.
My mailbox: gayxq@163.com
//////////////////////////////////////////////////////////////
Dim owner As Control = TryCast(Me.Owner, Control)
Dim screen As Screen = [If](owner Is Nothing, System.Windows.Forms.Screen.PrimaryScreen, System.Windows.Forms.Screen.FromControl(owner))
Dim background As Bitmap = New Bitmap(screen.Bounds.Width, screen.Bounds.Height)
Using g As Graphics = Graphics.FromImage(background)
g.CopyFromScreen(0, 0, 0, 0, screen.Bounds.Size)
Using br As Brush = New SolidBrush(Color.FromArgb(192, Color.Black))
g.FillRectangle(br, screen.Bounds)
End Using
If owner IsNot Nothing Then
Dim form As Form = owner.FindForm()
g.CopyFromScreen(form.Location, form.Location, form.Size)
Using br As Brush = New SolidBrush(Color.FromArgb(128, Color.Black))
g.FillRectangle(br, New Rectangle(form.Location, form.Size))
End Using
End If
Dim originalThread As IntPtr
Dim originalInput As IntPtr
Dim newDesktop As IntPtr
originalThread = GetThreadDesktop(Thread.CurrentThread.ManagedThreadId)
originalInput = OpenInputDesktop(0, False, DESKTOP_SWITCHDESKTOP)
newDesktop = CreateDesktop("Desktop" & Guid.NewGuid().ToString(), Nothing, Nothing, 0, GENERIC_ALL, Nothing)
SetThreadDesktop(newDesktop)
SwitchDesktop(newDesktop)
Dim newThread As Thread = New Thread(AddressOf NewThreadMethod)
newThread.Start(New VDialogLockSystemParameters(newDesktop, background))
newThread.Join()
SwitchDesktop(originalInput)
SetThreadDesktop(originalThread)
CloseDesktop(newDesktop)
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
Vista-like TaskDialog control for .NET Framework 2.0, compatible with Windows XP
| Type | Article |
| Licence | LGPL3 |
| First Posted | 7 Nov 2007 |
| Views | 142,229 |
| Downloads | 1,497 |
| Bookmarked | 235 times |
|
|