Placing Components on a Form
Although PowerTCP components can be used in your preferred environment on any machine that has the .NET Framework installed, the recommended method is to use them within the Visual Studio .NET environment.
Use the following steps to create an Validator component within Visual Studio .NET:
- Start Visual Studio .NET.
- From the File menu, choose New, then choose Project.
- From the resulting dialog box, choose either Visual C# Projects or Visual Basic Projects then choose Windows Application. Specify a name and a location for the project and click OK.
- Now add the Validator component to the form. To do this, right-click on the ToolBox and choose Customize ToolBox (see the screen shot below). If the ToolBox is not visible, navigate to the View menu and choose ToolBox.

- Now click the Validator component icon on the ToolBox, and "drag" an instance of it onto the form. The Visual Studio .NET environment will automatically create and instantiate an instance of the component.
- Now make a quick application to test. Drag a button onto the form.
- Add the following code to the button’s "Click" event handler:
[C#]
using Dart.PowerTCP.Validator;
private void button1_Click(object sender, System.EventArgs e)
{
// Test the syntax of an email address
ValidationState result = Validator1.Validate("myAddress@myDomain.com", ValidationLevel.Syntax);
if (result.Exception == null)
MessageBox.Show("The syntax is valid!");
else
MessageBox.Show(result.Exception.Message);
}
- Navigate to the Debug menu and choose Start. The app will compile and execute. Click the button and you should see a message appear.
In This Section
- Overview
- This topic provides an overview for using PowerTCP Email Validation for .NET.
- Placing Components on a Form
- This topic demonstrates how to create and use components using Visual Studio .NET.
- Creating Components Dynamically
- This topic demonstrates how to add a component as a reference using Visual Studio .NET.
- Synchronous vs. Asynchronous Use
- This topic discusses the benefits and uses for synchronous and asynchronous methods.
- Using Events
- This topic discusses how to use events with the component, both using Visual Studio .NET and in other environments.
Email Validation Using Menublock
Send comments on this topic.
Documentation version 1.0.3.0.
© 2008 Dart Communications. All rights reserved.