This documentation is archived and is not being maintained.

TemplatedControlDesigner.InTemplateMode Property

Gets a value indicating whether the designer document is in template mode.

[Visual Basic]
Public ReadOnly Property InTemplateMode As Boolean
[C#]
public bool InTemplateMode {get;}
[C++]
public: __property bool get_InTemplateMode();
[JScript]
public function get InTemplateMode() : Boolean;

Property Value

true if the designer document is in template mode; otherwise, false.

Remarks

A document is in template mode when a template is currently being viewed or edited in the forms designer.

Example

[Visual Basic] The following code example overrides the ControlDesigner.AllowResize property and uses either a custom TemplatesExist property or the InTemplateMode property to determine whether the control can be resized on the design surface or not.

[Visual Basic] 
Public Overrides ReadOnly Property AllowResize() As Boolean
   Get
      ' When templates are not defined, render a read-only,
      ' fixed-size block. Once templates are defined or
      ' are being edited, the control allows resizing.
      Return TemplatesExist Or InTemplateMode
   End Get
End Property

[C#, C++, JScript] No example is available for C#, C++, or JScript. To view a Visual Basic example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

TemplatedControlDesigner Class | TemplatedControlDesigner Members | System.Web.UI.Design Namespace

Show: