format
typescript
Control.formclass: Control
description
The Form that the current control belongs to.
A Form is a container in the user interface that is used to host and organize other UI elements (such as buttons, text boxes, images, etc.) to build a user interactive interface.
parameter
| param_name | type | description |
|---|
reture
| type | description |
|---|---|
Form|null | The Form that the control belongs to. |
code example
typeScript
let go = new GameObject("ui");
let uiComponent = go.AddComponent<UIComponent>(UIComponent);
let canvas = uiComponent.canvas;
let button = canvas.FindChild("Button");
button.form;