Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Example 4: changing the size and location of controls – PB Docs 125 – PowerBuilder Library

Example 4: changing the size and location of controls – PB Docs 125

Example 4: changing the size and location of controls

The following DataWindow object shows city and state columns
enclosed in a rectangle and underlined. The columns change location
if the current row contains data for a customer from the state of
New York. The rectangle and the line change both location and size.

cond055.gif

This example shows how to move the rectangle and line. The
process for columns is similar.

In the Design view, the rectangle and line display in one
location, with a single set of dimensions. The expressions you specify
are used only in Preview view and at runtime and all have the following
syntax:

The false value is the same as the value
in Design view. All of the values used in this example are in PowerBuilder
Units (PBUs), the default unit of measure used for the DataWindow object.

To change properties of the rectangle and the line for rows
with the state column equal to New York:

  1. Select the rectangle, display
    the Position page in the Properties view, and specify expressions
    for the following properties:

    Property

    Expression

    X

    if (state = 'NY',
    2890, 1865)

    Width

    if (state = 'NY',
    500, 1000)

    Height

    if (state = 'NY',
    160, 120)

  2. Select the line, display the Position page in the
    Properties view, and specify expressions for the following properties:

    Property

    Expression

    X1

    if (state = 'NY',
    2890, 1865)

    Y1

    if (state = 'NY',
    168, 132)

    X2

    if (state = 'NY',
    3400, 2865)

    Y2

    if (state = 'NY',
    168, 132)

  3. On the General page for the line, specify this expression
    for Pen Width:

    At runtime, the rectangle is taller and narrower, and the
    line is shorter and has a wider pen width.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x