Control.Open

From Xojo Documentation

Event


Control.Open()

Supported for all project types and targets.

The window is about to open. Use this event to initialize a control.

Notes

The Open event is called after the Constructor.

Be warned that initializing control property values using the Constructor instead of the Open event may result in those property values being overwritten by what is set in the Inspector. For best results, use the Open event for control initialization rather than the control Constructor.

Example

If the control is supposed to handle drag and drop, you need to tell it which type of item it needs to be able to handle. The following example informs the control that pictures and files can be dropped on it. The type of the file it needs to support is specified via the File Types Editor.

Sub Open()
Me.AcceptPictureDrop
Me.AcceptFileDrop("JPEG")
End Sub

See Also

Window.Open event; DragItem class.