RAD Studio for Microsoft .NET
ContentsIndex
PreviousUpNext
VCL for .NET Procedures

This section provides how-to information on developing VCL for .NET applications.

Name 
Description 
Each of the procedures listed below builds a VCL Form application that uses graphics. Build one or more of the examples.
  1. Draw straight lines.
  2. Draw rectangles and ellipses.
  3. Draw a polygon.
  4. Display a bitmap image.
  5. Place a bitmap in a combo box.
 
The following procedure describes how to build an ADO.NET database application.
Building a VCL.NET ADO.NET application consists of the following major steps:
  1. Set up the database connection.
  2. Set up the dataset.
  3. Set up the data provider, client dataset, and data source.
  4. Connect a DataGrid to the connection components.
  5. Run the application.
 
The following procedure illustrates the essential steps to building a VCL Forms application using RAD Studio. 
Using RAD Studio, the following procedures illustrate how to create actions using the ActionList tool. You will set up a simple application and create an edit menu with cut and paste actions that can be used to cut and paste to a memo.
Creating the VCL application consists of the following major steps:
  1. Add main menu, actionlist, and memo tools to a form.
  2. Create the cut and paste actions.
  3. Add the actions to the main menu and associate with the edit action category.
  4. Build and run the application.
 
The Windows Forms Hello World application demonstrates the essential steps for creating a VCL Forms application. The application uses a VCL Form, a control, an event, and displays a dialog in response to a user action.
Creating the Hello World application consists of the following steps:
  1. Create a VCL.NET Form with a button control.
  2. Write the code to display "Hello World" when the button is clicked.
  3. Run the application.
 
Using RAD Studio, the following procedure illustrates how to create actions using ActionManager. It sets up a simple user interface with a text area, as would be appropriate for a text editing application, and describes how to create a file menu item with a file open action.
Building the VCL application with ActionManager actions consists of the following major steps:
  1. Add a file open action to the ActionManager on a form.
  2. Create the main menu.
  3. Add the action to the menu.
  4. Build and run the application.
 
The following procedures describe how to build a dbExpress database application.
Building a VCL Forms dbExpress.NET application consists of the following major steps:
  1. Set up the database connection.
  2. Set up the unidirectional dataset.
  3. Set up the data provider, client dataset, and data source.
  4. Connect a DataGrid to the connection components.
  5. Run the application.
 
This example creates a VCL Forms application that uses an XMLDocument component to display contents in an XML file. 
Changes have been made to support 64-bit .NET 2.0. These changes might require minor code changes so that existing applications work correctly. This document describes these changes in detail. There are two general areas:
  1. Changed code patterns
  2. Windows API declarations for some callbacks and records
Warning: These changes are required due to changes made to support 64-bit systems. They must be made for applications intended for both 32-bit and 64-bit systems.
 
You can use the New VCL Component wizard to create a new VCL.NET component and add it to the Tool Palette
These procedures load a bitmap image from a file and displays it to a VCL form.
  1. Create a VCL form with a button control.
  2. Provide a bitmap image.
  3. Code the button's onClick event handler to load and display a bitmap image.
  4. Build and run the application.
 
These procedures draw a rectangle and ellipse in a VCL form.
  1. Create a VCL form.
  2. Code the form's OnPaint event handler to draw a rectangle and ellipse.
  3. Build and run the application.
 
These procedures draw a rounded rectangle in a VCL form.
  1. Create a VCL form.
  2. Code the form's OnPaint event handler to draw a polygon.
  3. Build and run the application.
 
These procedures draw two diagonal straight lines on an image in a VCL form.
  1. Create a VCL form.
  2. Code the form's OnPaint event handler to draw the straight lines.
  3. Build and run the application.
 
These procedures add a bitmap image to a combo box in a VCL forms application.
  1. Create a VCL form.
  2. Place components on the form.
  3. Set component properties in the Object Inspector.
  4. Write event handlers for the component's drawing action.
  5. Build and run the application.
 
You might want to use .NET components on your VCL.NET forms. There is no direct way to use .NET components. You can, however, wrap the components in an ActiveX wrapper, which then can be added to your VCL.NET application. RAD Studio provides the .NET Import Wizard to accomplish this task. 
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!