Element.Enable



Enable() As Boolean
ED
read only
RT
avaliable

Remarks

De/activates the dynamic element. If deactivated, actions like setting a value are not executed.

Usually this property returns True indicating, that the element is active. Setting it to False deactivates the element.

Hint: VBA macros are also executed, if the element is deactivated. Standard actions, e.g. executing functions for a button are not executed when deactivated.

Sample

The following example de/activates the dynamic element BITMAP_BTN_1, which is on the current picture, depending on the current status of the element.

'*** De/-activate element BITMAP_BTN_1
Public Sub LeftClickUp_Element_Enabled(obElem As Element)
	Dim obElement As Element
	Dim obPicture As DynPicture

	'*** Get picture-Object
	Set obPicture = obElem.Parent.Parent
	If (obPicture Is Nothing) Then
		MsgBox "Error: Picture-object is invalid..."
		Exit Sub
	End If

	'*** Get element BITMAP_BTN_1
	Set obElement = obPicture.Elements.Item("BITMAP_BTN_1")
	If (obElement Is Nothing) Then
		MsgBox "Error: element BITMAP_BTN_1 doesn't exists..."
		Exit Sub
	End If

	'*** De/-activate element
	obElement.Enable = Not obElement.Enable
	obElement.Update
End Sub

See Also

Element