Printer Friendly Version      Send     
Click to Rate and Give Feedback
MSDN
MSDN Library
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Task 1: Create the Simple Expense Report Application

In this task, you create the project file and Windows Form application that is used throughout the remainder of this tutorial. The project file contains the necessary assembly references that most Windows Workflow Foundation applications need. As you progress through the tutorial, you will edit this file to add new project files.

The Windows Form application contains the complete user interface for the tutorial. However, you will add additional logic to the Windows Form as you build the sequential workflow throughout the remaining exercises.

Creating the Project File

Follow these steps to create the project file for the expense report application. If you are using C#, give the project file the .csproj file name extension. If you are using Visual Basic, give it a .vbproj file name extension.

To create the SimpleExpenseReport project file

  1. In your project directory, create a new file named SimpleExpenseReport.

    Use the .csproj extension for a C# project or the .vbproj extension for a Visual Basic project.

  2. Copy and paste the following code into this project file.

    Visual Basic
    <?xml version="1.0" encoding="utf-8"?>
    <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup>
        <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
        <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
        <ProductVersion>8.0.50727</ProductVersion>
        <SchemaVersion>2.0</SchemaVersion>
        <ProjectGuid>{37000091-C9D4-4954-B65E-5EED0AD2CD55}</ProjectGuid>
        <ProjectTypeGuids>{D59BE175-2ED0-4C54-BE3D-CDAA9F3214C8};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
        <OutputType>WinExe</OutputType>
        <StartupObject>
        </StartupObject>
        <RootNamespace>SimpleExpenseReport</RootNamespace>
        <AssemblyName>SimpleExpenseReport</AssemblyName>
        <MyType>WindowsFormsWithCustomSubMain</MyType>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
        <DebugSymbols>true</DebugSymbols>
        <DebugType>full</DebugType>
        <DefineDebug>true</DefineDebug>
        <DefineTrace>true</DefineTrace>
        <IncrementalBuild>true</IncrementalBuild>
        <OutputPath>bin\</OutputPath>
        <DefineConstants>_MyType="Windows"</DefineConstants>
        <DocumentationFile>SimpleExpenseReport.xml</DocumentationFile>
        <UseVSHostingProcess>false</UseVSHostingProcess>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
        <DebugSymbols>false</DebugSymbols>
        <DefineDebug>false</DefineDebug>
        <DefineTrace>true</DefineTrace>
        <IncrementalBuild>false</IncrementalBuild>
        <Optimize>true</Optimize>
        <OutputPath>bin\</OutputPath>
        <DefineConstants>_MyType="Windows"</DefineConstants>
        <DocumentationFile>SimpleExpenseReport.xml</DocumentationFile>
        <UseVSHostingProcess>false</UseVSHostingProcess>
      </PropertyGroup>
      <ItemGroup>
        <Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
          <Name>System</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
        <Reference Include="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
          <Name>System.Data</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
        <Reference Include="System.Deployment" />
        <Reference Include="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
          <Name>System.Transactions</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
        <Reference Include="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
          <Name>System.Xml</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
        <Reference Include="System.Workflow.Activities, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
          <Name>System.Workflow.Activities</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
        <Reference Include="System.Workflow.ComponentModel, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
          <Name>System.Workflow.ComponentModel</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
        <Reference Include="System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
          <Name>System.Workflow.Runtime</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
        <Reference Include="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
          <Name>System.Design</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
        <Reference Include="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
          <Name>System.Drawing</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
        <Reference Include="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
          <Name>System.Drawing.Design</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
        <Reference Include="System.Windows.Forms">
          <Name>System.Windows.Forms</Name>
        </Reference>
        <Reference Include="mscorlib">
          <Name>mscorlib</Name>
        </Reference>
        <Reference Include="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86">
          <Name>System.Web</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
        <Reference Include="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
          <Name>System.Web.Services</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
      </ItemGroup>
      <ItemGroup>
        <Import Include="Microsoft.VisualBasic" />
        <Import Include="System" />
        <Import Include="System.Collections" />
        <Import Include="System.Data" />
        <Import Include="System.Diagnostics" />
      </ItemGroup>
      <ItemGroup>
        <Compile Include="Program.vb">
          <SubType>Form</SubType>
        </Compile>
      </ItemGroup>
      <Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.Targets" />
      <Import Project="$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.0\Workflow.VisualBasic.Targets" />
      <PropertyGroup>
        <PreBuildEvent>
        </PreBuildEvent>
        <PostBuildEvent>
        </PostBuildEvent>
      </PropertyGroup>
    </Project> 
    

    C#
    <?xml version="1.0" encoding="utf-8"?>
    <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup>
        <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
        <ProductVersion>8.0.50727</ProductVersion>
        <SchemaVersion>2.0</SchemaVersion>
        <ProjectGuid>{37000091-C9D4-4954-B65E-5EED0AD2CD55}</ProjectGuid>
        <OutputType>WinExe</OutputType>
        <RootNamespace>Microsoft.Samples.Workflow.Tutorials.SequentialWorkflow</RootNamespace>
        <AssemblyName>SimpleExpenseReport</AssemblyName>
        <ProjectTypeGuids>{14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
        <WarningLevel>4</WarningLevel>
        <StartupObject>
        </StartupObject>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
        <DebugSymbols>true</DebugSymbols>
        <DebugType>full</DebugType>
        <Optimize>false</Optimize>
        <OutputPath>.\bin\Debug\</OutputPath>
        <DefineConstants>DEBUG;TRACE</DefineConstants>
        <UseVSHostingProcess>false</UseVSHostingProcess>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
        <DebugSymbols>false</DebugSymbols>
        <Optimize>true</Optimize>
        <OutputPath>.\bin\Release\</OutputPath>
        <DefineConstants>TRACE</DefineConstants>
        <UseVSHostingProcess>false</UseVSHostingProcess>
      </PropertyGroup>
      <ItemGroup>
        <Reference Include="System.configuration" />
        <Reference Include="System.Windows.Forms" />
        <Reference Include="System.Workflow.Activities" />
        <Reference Include="System.Workflow.ComponentModel" />
        <Reference Include="System.Workflow.Runtime" />
        <Reference Include="System" />
        <Reference Include="System.Data" />
        <Reference Include="System.Design" />
        <Reference Include="System.Drawing" />
        <Reference Include="System.Drawing.Design" />
        <Reference Include="System.Transactions" />
        <Reference Include="System.Xml" />
        <Reference Include="System.Web" />
        <Reference Include="System.Web.Services" />
      </ItemGroup>
      <ItemGroup>
        <Compile Include="Program.cs">
          <SubType>Form</SubType>
        </Compile>
      </ItemGroup>
      <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
      <Import Project="$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.0\Workflow.Targets" />
    </Project>
    

Creating the Windows Form Application

Next, you create the Windows Forms application, which will contain the user interface for the remainder of the tutorial.

To create the simple expense report Windows Form application

  1. In your projects directory, create a new file named Program.

    Use the .cs file name extension for a C# application or the .vb file name extension for a Visual Basic application.

  2. In the Program source code file, add the following code for the Windows Form application.

    Visual Basic
    Imports Microsoft.VisualBasic
    Imports System
    Imports System.ComponentModel
    Imports System.Drawing
    Imports System.Windows.Forms
    Imports System.Collections.Generic
    Imports System.Workflow.Runtime
    Imports System.Workflow.Runtime.Hosting
    Imports System.Workflow.Activities
    Imports System.Threading
    
    Namespace Microsoft.Samples.Workflow.Tutorials.SequentialWorkflow
        Public Class MainForm : Inherits Form
            Private label1 As System.Windows.Forms.Label
            Private result As System.Windows.Forms.TextBox
            Private label2 As System.Windows.Forms.Label
            Private WithEvents submitButton As System.Windows.Forms.Button
            Private approvalState As System.Windows.Forms.Label
            Private WithEvents approveButton As System.Windows.Forms.Button
            Private WithEvents rejectButton As System.Windows.Forms.Button
            Private WithEvents amount As System.Windows.Forms.TextBox
            Private panel1 As System.Windows.Forms.Panel
    
            Private components As System.ComponentModel.IContainer = Nothing
    
            Public Sub New()
                InitializeComponent()
    
                ' Collapse approve/reject panel
                Me.Height = Me.MinimumSize.Height
            End Sub
    
            Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
                If disposing AndAlso (Not components Is Nothing) Then
                    components.Dispose()
                End If
                MyBase.Dispose(disposing)
            End Sub
    
            Private Sub InitializeComponent()
                Me.label1 = New System.Windows.Forms.Label()
                Me.result = New System.Windows.Forms.TextBox()
                Me.label2 = New System.Windows.Forms.Label()
                Me.submitButton = New System.Windows.Forms.Button()
                Me.approvalState = New System.Windows.Forms.Label()
                Me.approveButton = New System.Windows.Forms.Button()
                Me.rejectButton = New System.Windows.Forms.Button()
                Me.amount = New System.Windows.Forms.TextBox()
                Me.panel1 = New System.Windows.Forms.Panel()
                Me.panel1.SuspendLayout()
                Me.SuspendLayout()
                ' 
                ' label1
                ' 
                Me.label1.AutoSize = True
                Me.label1.Location = New System.Drawing.Point(10, 13)
                Me.label1.Name = "label1"
                Me.label1.Size = New System.Drawing.Size(43, 13)
                Me.label1.TabIndex = 1
                Me.label1.Text = "Amount"
                ' 
                ' result
                ' 
                Me.result.Location = New System.Drawing.Point(13, 70)
                Me.result.Name = "result"
                Me.result.ReadOnly = True
                Me.result.Size = New System.Drawing.Size(162, 20)
                Me.result.TabIndex = 1
                Me.result.TabStop = False
                ' 
                ' label2
                ' 
                Me.label2.AutoSize = True
                Me.label2.Location = New System.Drawing.Point(10, 54)
                Me.label2.Name = "label2"
                Me.label2.Size = New System.Drawing.Size(37, 13)
                Me.label2.TabIndex = 3
                Me.label2.Text = "Result"
                ' 
                ' submitButton
                ' 
                Me.submitButton.Enabled = False
                Me.submitButton.Location = New System.Drawing.Point(56, 95)
                Me.submitButton.Name = "submitButton"
                Me.submitButton.Size = New System.Drawing.Size(75, 23)
                Me.submitButton.TabIndex = 2
                Me.submitButton.Text = "Submit"
                ' 
                ' approvalState
                ' 
                Me.approvalState.AutoSize = True
                Me.approvalState.Location = New System.Drawing.Point(10, 9)
                Me.approvalState.Name = "approvalState"
                Me.approvalState.Size = New System.Drawing.Size(49, 13)
                Me.approvalState.TabIndex = 4
                Me.approvalState.Text = "Approval"
                ' 
                ' approveButton
                ' 
                Me.approveButton.Enabled = False
                Me.approveButton.Location = New System.Drawing.Point(11, 25)
                Me.approveButton.Name = "approveButton"
                Me.approveButton.Size = New System.Drawing.Size(75, 23)
                Me.approveButton.TabIndex = 0
                Me.approveButton.Text = "Approve"
                ' 
                ' rejectButton
                ' 
                Me.rejectButton.Enabled = False
                Me.rejectButton.Location = New System.Drawing.Point(86, 25)
                Me.rejectButton.Name = "rejectButton"
                Me.rejectButton.Size = New System.Drawing.Size(75, 23)
                Me.rejectButton.TabIndex = 1
                Me.rejectButton.Text = "Reject"
                ' 
                ' amount
                ' 
                Me.amount.Location = New System.Drawing.Point(13, 29)
                Me.amount.MaxLength = 9
                Me.amount.Name = "amount"
                Me.amount.Size = New System.Drawing.Size(162, 20)
                Me.amount.TabIndex = 0
                ' 
                ' panel1
                ' 
                Me.panel1.Controls.Add(Me.approvalState)
                Me.panel1.Controls.Add(Me.approveButton)
                Me.panel1.Controls.Add(Me.rejectButton)
                Me.panel1.Location = New System.Drawing.Point(7, 124)
                Me.panel1.Name = "panel1"
                Me.panel1.Size = New System.Drawing.Size(172, 66)
                Me.panel1.TabIndex = 8
                ' 
                ' MainForm
                ' 
                Me.AcceptButton = Me.submitButton
                Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0F, 13.0F)
                Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
                Me.ClientSize = New System.Drawing.Size(187, 201)
                Me.MinimumSize = New System.Drawing.Size(197,155)
                Me.MinimumSize = New System.Drawing.Size(197, 155)
                Me.Controls.Add(Me.result)
                Me.Controls.Add(Me.label2)
                Me.Controls.Add(Me.panel1)
                Me.Controls.Add(Me.amount)
                Me.Controls.Add(Me.submitButton)
                Me.Controls.Add(Me.label1)
                Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D
                Me.MaximizeBox = False
                Me.MinimizeBox = False
                Me.Name = "MainForm"
                Me.Text = "Simple Expense Report"
                Me.panel1.ResumeLayout(False)
                Me.panel1.PerformLayout()
                Me.ResumeLayout(False)
                Me.PerformLayout()
    
            End Sub
    
            Private Sub submitButton_Click(ByVal sender As Object, ByVal e As EventArgs) _
            Handles submitButton.Click
            End Sub
    
            Private Sub approveButton_Click(ByVal sender As Object, ByVal e As EventArgs) _
            Handles approveButton.Click
            End Sub
    
            Private Sub rejectButton_Click(ByVal sender As Object, ByVal e As EventArgs) _
            Handles rejectButton.Click
            End Sub
    
            Private Sub amount_KeyPress(ByVal sender As Object, _
            ByVal e As KeyPressEventArgs) Handles amount.KeyPress
                If (Not Char.IsControl(e.KeyChar)) AndAlso ((Not Char.IsDigit(e.KeyChar))) _
                Then
                    e.KeyChar = Char.MinValue
                End If
            End Sub
    
            Private Sub amount_TextChanged(ByVal sender As Object, _
            ByVal e As EventArgs) Handles amount.TextChanged
                submitButton.Enabled = amount.Text.Length > 0
            End Sub
        End Class
    
        Friend Class Program
            Private Sub New()
            End Sub
            <STAThread()> _
            Shared Sub Main()
                Application.EnableVisualStyles()
                Application.Run(New MainForm())
            End Sub
        End Class
    End Namespace
    
    C#
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
    using System.Collections.Generic;
    using System.Workflow.Runtime;
    using System.Workflow.Runtime.Hosting;
    using System.Workflow.Activities;
    using System.Threading;
    
    namespace Microsoft.Samples.Workflow.Tutorials.SequentialWorkflow
    {
        public class MainForm : Form
        {
            private System.Windows.Forms.Label label1;
            private System.Windows.Forms.TextBox result;
            private System.Windows.Forms.Label label2;
            private System.Windows.Forms.Button submitButton;
            private System.Windows.Forms.Label approvalState;
            private System.Windows.Forms.Button approveButton;
            private System.Windows.Forms.Button rejectButton;
            private System.Windows.Forms.TextBox amount;
            private System.Windows.Forms.Panel panel1;
    
            private System.ComponentModel.IContainer components = null;
    
            public MainForm()
            {
                InitializeComponent();
    
                // Collapse approve/reject panel
                this.Height = this.MinimumSize.Height;
            }
    
            protected override void Dispose(bool disposing)
            {
                if (disposing && (components != null))
                {
                    components.Dispose();
                }
                base.Dispose(disposing);
            }
    
            private void InitializeComponent()
            {
                this.label1 = new System.Windows.Forms.Label();
                this.result = new System.Windows.Forms.TextBox();
                this.label2 = new System.Windows.Forms.Label();
                this.submitButton = new System.Windows.Forms.Button();
                this.approvalState = new System.Windows.Forms.Label();
                this.approveButton = new System.Windows.Forms.Button();
                this.rejectButton = new System.Windows.Forms.Button();
                this.amount = new System.Windows.Forms.TextBox();
                this.panel1 = new System.Windows.Forms.Panel();
                this.panel1.SuspendLayout();
                this.SuspendLayout();
                // 
                // label1
                // 
                this.label1.AutoSize = true;
                this.label1.Location = new System.Drawing.Point(10, 13);
                this.label1.Name = "label1";
                this.label1.Size = new System.Drawing.Size(43, 13);
                this.label1.TabIndex = 1;
                this.label1.Text = "Amount";
                // 
                // result
                // 
                this.result.Location = new System.Drawing.Point(13, 70);
                this.result.Name = "result";
                this.result.ReadOnly = true;
                this.result.Size = new System.Drawing.Size(162, 20);
                this.result.TabIndex = 1;
                this.result.TabStop = false;
                // 
                // label2
                // 
                this.label2.AutoSize = true;
                this.label2.Location = new System.Drawing.Point(10, 54);
                this.label2.Name = "label2";
                this.label2.Size = new System.Drawing.Size(37, 13);
                this.label2.TabIndex = 3;
                this.label2.Text = "Result";
                // 
                // submitButton
                // 
                this.submitButton.Enabled = false;
                this.submitButton.Location = new System.Drawing.Point(56, 95);
                this.submitButton.Name = "submitButton";
                this.submitButton.Size = new System.Drawing.Size(75, 23);
                this.submitButton.TabIndex = 2;
                this.submitButton.Text = "Submit";
                this.submitButton.Click += new
                    System.EventHandler(this.submitButton_Click);
                // 
                // approvalState
                // 
                this.approvalState.AutoSize = true;
                this.approvalState.Location = new System.Drawing.Point(10, 9);
                this.approvalState.Name = "approvalState";
                this.approvalState.Size = new System.Drawing.Size(49, 13);
                this.approvalState.TabIndex = 4;
                this.approvalState.Text = "Approval";
                // 
                // approveButton
                // 
                this.approveButton.Enabled = false;
                this.approveButton.Location = new System.Drawing.Point(11, 25);
                this.approveButton.Name = "approveButton";
                this.approveButton.Size = new System.Drawing.Size(75, 23);
                this.approveButton.TabIndex = 0;
                this.approveButton.Text = "Approve";
                this.approveButton.Click += new
                    System.EventHandler(this.approveButton_Click);
                // 
                // rejectButton
                // 
                this.rejectButton.Enabled = false;
                this.rejectButton.Location = new System.Drawing.Point(86, 25);
                this.rejectButton.Name = "rejectButton";
                this.rejectButton.Size = new System.Drawing.Size(75, 23);
                this.rejectButton.TabIndex = 1;
                this.rejectButton.Text = "Reject";
                this.rejectButton.Click += new
                    System.EventHandler(this.rejectButton_Click);
                // 
                // amount
                // 
                this.amount.Location = new System.Drawing.Point(13, 29);
                this.amount.MaxLength = 9;
                this.amount.Name = "amount";
                this.amount.Size = new System.Drawing.Size(162, 20);
                this.amount.TabIndex = 0;
                this.amount.KeyPress += new 
                    System.Windows.Forms.KeyPressEventHandler(this.amount_KeyPress);
                this.amount.TextChanged += new
                    System.EventHandler(this.amount_TextChanged);
                // 
                // panel1
                // 
                this.panel1.Controls.Add(this.approvalState);
                this.panel1.Controls.Add(this.approveButton);
                this.panel1.Controls.Add(this.rejectButton);
                this.panel1.Location = new System.Drawing.Point(7, 124);
                this.panel1.Name = "panel1";
                this.panel1.Size = new System.Drawing.Size(172, 66);
                this.panel1.TabIndex = 8;
                // 
                // MainForm
                // 
                this.AcceptButton = this.submitButton;
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.ClientSize = new System.Drawing.Size(187, 201);
                this.MinimumSize = new System.Drawing.Size(197, 155);
                this.Controls.Add(this.result);
                this.Controls.Add(this.label2);
                this.Controls.Add(this.panel1);
                this.Controls.Add(this.amount);
                this.Controls.Add(this.submitButton);
                this.Controls.Add(this.label1);
                this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
                this.MaximizeBox = false;
                this.MinimizeBox = false;
                this.Name = "MainForm";
                this.Text = "Simple Expense Report";
                this.panel1.ResumeLayout(false);
                this.panel1.PerformLayout();
                this.ResumeLayout(false);
                this.PerformLayout();
    
            }
    
            private void submitButton_Click(object sender, EventArgs e)
            {
            }
    
            private void approveButton_Click(object sender, EventArgs e)
            {
            }
    
            private void rejectButton_Click(object sender, EventArgs e)
            {
            }
    
            private void amount_KeyPress(object sender, KeyPressEventArgs e)
            {
                if (!Char.IsControl(e.KeyChar) && (!Char.IsDigit(e.KeyChar)))
                    e.KeyChar = Char.MinValue;
            }
    
            private void amount_TextChanged(object sender, EventArgs e)
            {
                submitButton.Enabled = amount.Text.Length > 0;
            }
        }
    
        static class Program
        {
            [STAThread]
            static void Main()
            {
                Application.EnableVisualStyles();
                Application.Run(new MainForm());
            }
        }
    }
    
  3. Build and run your application.

    Your Windows Form application should look similar to the following figure:

Compiling the Code

  1. Click Start, point to Programs, point to Microsoft .NET Framework SDK v2.0, and then click SDK Command Prompt.

  2. Go to the source directory of the tutorial.

  3. At the command prompt, type MSBUILD to build the project.

In Task 2: Create the Sequential Workflow, you create the workflow source file that you will use for the rest of the tutorial.

See Also

Footer image
Send comments about this topic to Microsoft.
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker