This is called Task Dialog and its a part of WindowsAPICodePack, available for download from: http://archive.msdn.microsoft.com/WindowsAPICodePack/
What we're going to do in this article is to create a Task Dialog with customizable texts and a hyperlink that opens your webpage using Process.
The application will look like this(its a localized Windows 7 by the way):
First of all create a new windows forms application.Then add these references:Microsoft.WindowsAPICodePack.dllwhich can be found on your extracted archive after you downloaded it:..\Windows API Code Pack 1.1\Windows API Code Pack 1.1\binaries\Microsoft.WindowsAPICodePack.dll
After that create a TaskDialogCommandLink variable:TaskDialogCommandLink link = null;
TaskDialogCommandLink link =
null
;
This will help us to access it from another event to open your website.
Now lets keep going...Create a TaskDialog variableTaskDialog dia = new TaskDialog();
TaskDialog dia =
new
TaskDialog();
This is the Dialog Window we wish to create.Here we created it actually
Lets play with its properties by adding more functionality to it:
dia.Cancelable =
true
dia.InstructionText =
"Friend Request"
dia.StandardButtons = TaskDialogStandardButtons.Yes | TaskDialogStandardButtons.No; Cancelable means we can close/cancel the dialog if we want.InstructionText is the above text inside the dialog.You can give it a general name like Friend Request,Mail Sent,Password Changed and goes on...StandardButtons are as you can see,added two of them;Now lets play with CommandLink: link = new TaskDialogCommandLink("http://www.iersoy.com","Anonymous just added you as Friend in Facebook!","Do you accept?");link.UseElevationIcon = true;link.Enabled = true;link.Click+=new EventHandler(link_Click);
link =
TaskDialogCommandLink(
"http://www.iersoy.com"
,
"Anonymous just added you as Friend in Facebook!"
"Do you accept?"
);
link.UseElevationIcon =
link.Enabled =
link.Click+=
EventHandler(link_Click);
public
void
link_Click(
object
sender, EventArgs e)
{
Process.Start(link.Name);
}
dia.Controls.Add(link);
dia.DetailsExpanded =
false
dia.DetailsExpandedText =
"Annonymous is a world-wide hacktivist group"
dia.ExpansionMode = TaskDialogExpandedDetailsLocation.ExpandFooter;
dia.Caption =
"Information!"
dia.Show();
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: