How Do I Change the Properties of a .NET Object? (Magic xpa 4.x)

« Go Back


Created BySalesforce Service User
Approval Process StatusPublished

How Do I Change the Properties of a .NET Object? (Magic xpa 4.x)

Once you have defined a .NET object, there are two ways to change its properties.

  1. If the object is visible on the form, you can edit the properties in the Form tab, or set the property using an expression. This is simple to code and is instantaneous at runtime. It is described in How Do I Change the Properties of a .NET Control?.

  2. Or, you can use the DNSet() function. This allows you to set the properties at a specific time, using an Event handler. This is described in this section.

The DNSet() function is used with an Evaluate Expression, to set the properties of a .NET object. To enter the function:

  1. Type DNSET(

  2. Type the .NET object’s variable ID (A, in this example), or select it from the variable list to the right.

  3. Enter a dot (.). At this point, a list of object properties will appear. Choose ShowWeekNumbers.

  4. Enter a comma (,).

  5. Enter the value that will update the property. In this example, it is a logical variable, B.

  6. Enter the closing parenthesis.

The list of properties that appears is for your convenience, and works like auto-complete for Magic xpa internal functions. You can show the list again by pressing Ctrl+Space, as you would for entering a Magic xpa function. However, you can also manually type in the entire expression: DNSet(A.ShowWeekNumbers,B).

In this example, the value used to update the property is a simple logical value. Some properties, however, require enumerated values, and you will need to use a .NET method to supply those. See How Do I Use .NET Enums?.

See also

The Online and Rich Client Samples projects (program NE02 and RNE02)