SETPROP Examples


Example 1:

 

RADIO1

RADIO

 

  

...

 

  

SETPROP

RADIO,ENABLED=0

 

This SETPROP instruction disables the RADIO button by changing the ENABLE property to false (0).

 

Example 2:

 

RADIO1

RADIO

 

  

...

 

  

SETPROP

RADIO,ENABLED=0,VALUE=1

 

This SETPROP instruction disables the RADIO button by changing the ENABLE property to false (0) and sets the value of the button to true(1).

 

Example 3:

 

  

SETPROP

FLEXGRID,*COLWIDTH(5)=100

 

This SETPROP instruction changes the width of the fifth column of the FLEXGRID OLE object to one hundred (100).

Example 4:

 

A

NETOBJECT

 

B

NETOBJECT

 

C

NETOBJECT

 

DATA

DIM

100

AUTOTRUE

INTEGER

4,"0xFFFFFFFF"

BOOLTRUE

VARIANT

 

BOOLFALSE

VARIANT

 

.

 

 

 

CREATE

BoolTrue,VarType=11,VarValue=AutoTrue

 

CREATE

BoolFalse,VarType=11,VarValue=0

.

 

 

 

CREATE

A,CLASS="System.Windows.Forms.Form":

 

 

Assembly="System.Windows.Forms"

 

CREATE

B,CLASS="System.Windows.Forms.Button":

 

 

Assembly="System.Windows.Forms":

 

 

*Text="Good",*Location="10,10"

 

CREATE

C,CLASS="System.Windows.Forms.Button":

 

 

Assembly="System.Windows.Forms"

.

 

 

 

SETPROP

A,*MaximizeBox=BoolFalse,*MinimizeBox=BoolFalse:

 

 

*HelpButton=BoolTrue

 

SETPROP

A,*Visible=BoolTrue,*Text="Hello .NET World!"

 

SETPROP

C,*Text="Cancel",*Location="10,50"

 

SETPROP

A,*AcceptButton=B,*CancelButton=C

.

 

 

 

A.Controls.Add

Using B ;Add .NET Button to .NET Window

 

A.Controls.Add

Using C ;Add .NET Button to .NET Window

.

 

 

 

GETPROP

A,*Text=DATA

 

DISPLAY

"*Text........:",*LL,DATA,"<<<"

.

 

 

 

GETPROP

A,*Bounds=DATA

 

DISPLAY

"*Bounds......:",*LL,DATA,"<<<"

.

 

 

 

GETPROP

A,*Font=DATA

 

DISPLAY

"*Font........:",*LL,DATA,"<<<"

.

 

 

 

LOOP

 

 

EVENTWAIT

 

 

REPEAT

 

 

This examples shows the SETPROP instruction used with a NETOBJECT.

 

Example 5:

 

ARR

BUTTON

(3)

I

FORM

1

APPEAR

INTEGER

4,("1"),("2"),("1")

.

 

 

 

FOR

I,1,3

 

PACK

S$CMDLIN,"Test",I

 

CREATE

ARR(I)=(I*2):((I*2)+1):5:20, TITLE=S$CMDLIN

 

REPEAT

 

.

 

 

 

SETPROP

Arr,Appearance=Appear,Visible=1

 

This SETPROP instruction changes the appearance properties of all items in the button array.

 

 

See Also: Collection Examples

 



PL/B Language Reference SETMODE MCURSOR Example SFORMAT Examples