You cannot set DisplayType while the control contains an object (Error 31040)

You tried to change the DisplayType property while the control contains an object.

Remove the object, then set the DisplayType property.