指定したデザイナ ホストを使用して、指定したコントロールのを永続化形式を表すデータの文字列を取得します。
Overloads Public Shared Function PersistControl( _
ByVal control As Control, _ ByVal host As IDesignerHost _) As String
[C#]
public static string PersistControl(Controlcontrol,IDesignerHosthost);
[C++]
public: static String* PersistControl(Control* control,IDesignerHost* host);
[JScript]
public static function PersistControl(
control : Control,host : IDesignerHost) : String;
パラメータ
- control
永続化する Control 。 - host
コントロールのデザイナ ホストである IDesignerHost 。
戻り値
コントロールの永続化形式を表す文字列。
解説
このメソッドが正しく動作するには IDesignerHost の実装が必要です。
使用例
' Parse the selected control.
Dim persistedData As String = ControlPersister.PersistControl( _
controlArray(selectionForm.controlList.SelectedIndex))
[C#]
// Parse the selected control.
string persistedData = ControlPersister.PersistControl(
controlArray[selectionForm.controlList.SelectedIndex]);
[C++]
// Parse the selected control.
String* persistedData =
ControlPersister::PersistControl( controlArray[selectionForm->controlList->SelectedIndex]);
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン
をクリックします。
必要条件
プラットフォーム: Windows 2000, Windows XP Professional, Windows Server 2003 ファミリ
.NET Framework セキュリティ:
- 直前の呼び出し元の完全信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細の参照先 : 部分信頼コードからのライブラリの使用
参照
ControlPersister クラス | ControlPersister メンバ | System.Web.UI.Design 名前空間 | ControlPersister.PersistControl オーバーロードの一覧