次の方法で共有


TemplatedControlDesigner.InTemplateMode プロパティ

デザイナ ドキュメントが現在テンプレート モードかどうかを示す値を取得します。

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

プロパティ値

デザイナ ドキュメントがテンプレート モードの場合は true 。それ以外の場合は false

解説

テンプレートが現在フォーム デザイナで表示中または編集中であるときは、ドキュメントはテンプレート モードです。

使用例

[Visual Basic] 次のコードは、 ControlDesigner.AllowResize プロパティをオーバーライドし、カスタムの TemplatesExist プロパティか InTemplateMode プロパティを使用して、デザイン画面でコントロールのサイズ変更が可能かどうかを確認します。

 
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] C#、C++、および JScript のサンプルはありません。Visual Basic のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 2000, Windows XP Professional, Windows Server 2003 ファミリ

.NET Framework セキュリティ:

参照

TemplatedControlDesigner クラス | TemplatedControlDesigner メンバ | System.Web.UI.Design 名前空間