Creating Controls Dynamically on a Panel

G Types allow you to reuse controls throughout your project. You can use G Types to create and delete controls dynamically at run time.

What to Use

What to Do

Create the following diagram to create and delete controls at run time.


1378

1378

Create a control on the panel according to the specified x and y positions. Select the Create Dynamic Control node and use the Data type option on the Item tab to specify the G Type that contains the control.

The Create Dynamic Control node also returns a reference to the control.

1378

Wait for 500 milliseconds before executing the next subdiagram.

You can add a Property Node to change the properties of the control.

1378

Delete the control from the panel.

1378

Repeat the subdiagram for ten times. The shift registers pass the x position value from one iteration to the next.