property Surface.AllowCreateObject as AllowKeysEnum
Specifies the combination of keys that allows the user to create objects on the surface.

TypeDescription
AllowKeysEnum An AllowKeysEnum expression that specifies the keys combination to allow user creates new elements on the surface.
By default, the AllowCreateObject property exLeftClick + exDblClick, which means that a double click on the surface will create new elements. The AllowCreateObject property specifies the combination of keys that allows the user to create objects on the surface. Set the AllowCreateObject property on exDisallow to prevent creating new elements at runtime. Use the Background(exCreateObjectColor) property to specify color or visual appearance of the creation rectangle when the user creates a new object. The CreateElement event occurs when the user creates the element on the surface. The control fires the LayoutStartChanging(exCreateObject) / LayoutEndChanging(exCreateObject) event when the user creates a new element on the surface.

The order of the events when the user creates the element at runtime is:

The following screen shot shows the creating rectangle: