The Ambient object is used in control events to provide supporting information.
The Ambient object cannot be created in code.
Example:
There is a button (TCEButtons.Button) with name btnOK created and displayed on a form. The Click event of btnOK contains the following code.
The user clicks the button on runtime.
Private Function Click(ByVal Ambient As Ambient) As Void
MsgBox("The button |Ambient.Control.Name| is clicked", MsgBoxStyle.Information)
End Function
Result: A message box is shown with the message “The button btnOK is clicked”.