DesktopControl.Opening

From Xojo Documentation

Revision as of 14:32, 18 December 2021 by Gperlman (talk | contribs) (Notes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
Event


DesktopControl.Opening()

New in 2021r3

Supported for all project types and targets.

The control is about to be displayed. Use this event to initialize a control.

Notes

The Opening event is called after the Constructor.

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

Sample Code

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 Opening()
Me.AcceptPictureDrop
Me.AcceptFileDrop("JPEG")
End Sub

See Also

DesktopWindow.Opening event; DragItem class