Salesforce

How Do I Add a Calendar Control? (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

How Do I Add a Calendar Control? (Magic xpa 3.x)

A good starting project for working with .NET is to create a Calendar control. The .NET Calendar control has more features than the usual Windows Calendar control, and you will find it is useful for much of your Rich Client programming. This project will utilize some of the processes described in other sections of this chapter, and can be used as an example for various features found in .NET.

To use a .NET control, you first need to specify its object type in either a model or a variable.

Using a .NET Model

  1. Create a .NET control model with the Object Type set to System.Windows.Forms.MonthCalendar.

  2. Define the mapping rules for the .NET model (described in How Do I Bind Data to a .NET Control?).

  3. Create a Rich Client task.

  4. Place the Calendar control onto your form (described in How Do I Define a .NET Control?).

  5. Assign the .NET control model to the .NET control.

  6. Add a Date variable and assign it to the Data property of the .NET control. Any change to this value will be seen on the .NET control and any change in the .NET control will be seen in this variable.

See also: The Online and Rich Client Samples projects (program NE11 and RNE11)

Since version: 2.1

Using a .NET Variable

  1. Create a Rich Client task.

  2. Create the Calendar Control Variable for System.Windows.Forms.MonthCalendar (described in How Do I Define a .NET Object?).

  3. Place the Calendar control onto your form (described in How Do I Define a .NET Control?).

  4. Create an event that will return the values that the user selected from the calendar (described in How Do I Change the Properties of a .NET Object?).

See also: The Online and Rich Client Samples projects (program NE01 and RNE01)

Additional Functionality

  1. Customize the Calendar properties according to your needs (described in How Do I Change the Properties of a .NET Control?).

  2. Optionally, you can allow the user to customize the calendar, setting properties interactively (described in How Do I Use .NET Enums?).

Reference
Attachment 
Attachment