PropertyValueUIItem クラス
アセンブリ: System.Drawing (system.drawing.dll 内)
HorizontalMargin または VerticalMargin という名前のコンポーネントのプロパティの PropertyValueUIItem オブジェクトを次のコード例に示します。なお、この PropertyValueUIItem は、対象のプロパティにイメージとツールヒントを提供するだけでなく、それらのプロパティのイメージがクリックされたときにメッセージ ボックスを表示するイベント ハンドラも提供します。このコード例は IPropertyValueUIService インターフェイスのトピックで取り上げているコード例の一部分です。
' PropertyValueUIHandler delegate that provides PropertyValueUIItem ' objects to any properties named HorizontalMargin or VerticalMargin. Private Sub marginPropertyValueUIHandler(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal propDesc As System.ComponentModel.PropertyDescriptor, ByVal itemList As ArrayList) ' A PropertyValueUIHandler added to the IPropertyValueUIService ' is queried once for each property of a component and passed ' a PropertyDescriptor that represents the characteristics of ' the property when the Properties window is set to a new ' component. A PropertyValueUIHandler can determine whether ' to add a PropertyValueUIItem for the object to its ValueUIItem ' list depending on the values of the PropertyDescriptor. If propDesc.DisplayName.Equals("HorizontalMargin") Then Dim img As Image = DeserializeFromBase64Text(imageBlob1) itemList.Add(New PropertyValueUIItem(img, New PropertyValueUIItemInvokeHandler(AddressOf Me.marginInvoke), "Test ToolTip")) End If If propDesc.DisplayName.Equals("VerticalMargin") Then Dim img As Image = DeserializeFromBase64Text(imageBlob1) img.RotateFlip(RotateFlipType.Rotate90FlipNone) itemList.Add(New PropertyValueUIItem(img, New PropertyValueUIItemInvokeHandler(AddressOf Me.marginInvoke), "Test ToolTip")) End If End Sub
// PropertyValueUIHandler delegate that provides PropertyValueUIItem // objects to any properties named HorizontalMargin or VerticalMargin. private void marginPropertyValueUIHandler(System.ComponentModel.ITypeDescriptorContext context, System.ComponentModel.PropertyDescriptor propDesc, ArrayList itemList) { // A PropertyValueUIHandler added to the IPropertyValueUIService // is queried once for each property of a component and passed // a PropertyDescriptor that represents the characteristics of // the property when the Properties window is set to a new // component. A PropertyValueUIHandler can determine whether // to add a PropertyValueUIItem for the object to its ValueUIItem // list depending on the values of the PropertyDescriptor. if( propDesc.DisplayName.Equals( "HorizontalMargin" ) ) { Image img = DeserializeFromBase64Text(imageBlob1); itemList.Add( new PropertyValueUIItem( img, new PropertyValueUIItemInvokeHandler(this.marginInvoke), "Test ToolTip") ); } if( propDesc.DisplayName.Equals( "VerticalMargin" ) ) { Image img = DeserializeFromBase64Text(imageBlob1); img.RotateFlip(RotateFlipType.Rotate90FlipNone); itemList.Add( new PropertyValueUIItem( img, new PropertyValueUIItemInvokeHandler(this.marginInvoke), "Test ToolTip") ); } }
// PropertyValueUIHandler delegate that provides PropertyValueUIItem // objects to any properties named horizontalMargin or verticalMargin. void marginPropertyValueUIHandler( System::ComponentModel::ITypeDescriptorContext^ /*context*/, System::ComponentModel::PropertyDescriptor^ propDesc, ArrayList^ itemList ) { // A PropertyValueUIHandler added to the IPropertyValueUIService // is queried once for each property of a component and passed // a PropertyDescriptor that represents the characteristics of // the property when the Properties window is set to a new // component. A PropertyValueUIHandler can determine whether // to add a PropertyValueUIItem for the object to its ValueUIItem // list depending on the values of the PropertyDescriptor. if ( propDesc->DisplayName->Equals( "horizontalMargin" ) ) { Image^ img = DeserializeFromBase64Text( imageBlob1 ); itemList->Add( gcnew PropertyValueUIItem( img,gcnew PropertyValueUIItemInvokeHandler( this, &PropertyUIComponent::marginInvoke ),"Test ToolTip" ) ); } if ( propDesc->DisplayName->Equals( "verticalMargin" ) ) { Image^ img = DeserializeFromBase64Text( imageBlob1 ); img->RotateFlip( RotateFlipType::Rotate90FlipNone ); itemList->Add( gcnew PropertyValueUIItem( img,gcnew PropertyValueUIItemInvokeHandler( this, &PropertyUIComponent::marginInvoke ),"Test ToolTip" ) ); } }
// PropertyValueUIHandler delegate that provides PropertyValueUIItem // objects to any properties named HorizontalMargin or VerticalMargin. private void MarginPropertyValueUIHandler(System.ComponentModel. ITypeDescriptorContext context, System.ComponentModel. PropertyDescriptor propDesc, ArrayList itemList) { // A PropertyValueUIHandler added to the IPropertyValueUIService // is queried once for each property of a component and passed // a PropertyDescriptor that represents the characteristics of // the property when the Properties window is set to a new // component. A PropertyValueUIHandler can determine whether // to add a PropertyValueUIItem for the object to its ValueUIItem // list depending on the values of the PropertyDescriptor. if (propDesc.get_DisplayName().Equals("HorizontalMargin")) { Image img = DeserializeFromBase64Text(imageBlob1); itemList.Add(new PropertyValueUIItem(img, new PropertyValueUIItemInvokeHandler(this.MarginInvoke) , "Test ToolTip")); } if (propDesc.get_DisplayName().Equals("VerticalMargin")) { Image img = DeserializeFromBase64Text(imageBlob1); img.RotateFlip(RotateFlipType.Rotate90FlipNone); itemList.Add(new PropertyValueUIItem(img, new PropertyValueUIItemInvokeHandler(this.MarginInvoke) , "Test ToolTip")); } } //MarginPropertyValueUIHandler
System.Drawing.Design.PropertyValueUIItem
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
PropertyValueUIItem コンストラクタ
アセンブリ: System.Drawing (system.drawing.dll 内)
Public Sub New ( _ uiItemImage As Image, _ handler As PropertyValueUIItemInvokeHandler, _ tooltip As String _ )
Dim uiItemImage As Image Dim handler As PropertyValueUIItemInvokeHandler Dim tooltip As String Dim instance As New PropertyValueUIItem(uiItemImage, handler, tooltip)
public PropertyValueUIItem ( Image uiItemImage, PropertyValueUIItemInvokeHandler handler, string tooltip )
public: PropertyValueUIItem ( Image^ uiItemImage, PropertyValueUIItemInvokeHandler^ handler, String^ tooltip )
public PropertyValueUIItem ( Image uiItemImage, PropertyValueUIItemInvokeHandler handler, String tooltip )
public function PropertyValueUIItem ( uiItemImage : Image, handler : PropertyValueUIItemInvokeHandler, tooltip : String )
HorizontalMargin または VerticalMargin という名前のコンポーネントのプロパティの PropertyValueUIItem オブジェクトを次のコード例に示します。なお、この PropertyValueUIItem は、対象のプロパティにイメージとツールヒントを提供するだけでなく、それらのプロパティのイメージがクリックされたときにメッセージ ボックスを表示するイベント ハンドラも提供します。このコード例は IPropertyValueUIService インターフェイスのトピックで取り上げているコード例の一部分です。
' PropertyValueUIHandler delegate that provides PropertyValueUIItem ' objects to any properties named HorizontalMargin or VerticalMargin. Private Sub marginPropertyValueUIHandler(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal propDesc As System.ComponentModel.PropertyDescriptor, ByVal itemList As ArrayList) ' A PropertyValueUIHandler added to the IPropertyValueUIService ' is queried once for each property of a component and passed ' a PropertyDescriptor that represents the characteristics of ' the property when the Properties window is set to a new ' component. A PropertyValueUIHandler can determine whether ' to add a PropertyValueUIItem for the object to its ValueUIItem ' list depending on the values of the PropertyDescriptor. If propDesc.DisplayName.Equals("HorizontalMargin") Then Dim img As Image = DeserializeFromBase64Text(imageBlob1) itemList.Add(New PropertyValueUIItem(img, New PropertyValueUIItemInvokeHandler(AddressOf Me.marginInvoke), "Test ToolTip")) End If If propDesc.DisplayName.Equals("VerticalMargin") Then Dim img As Image = DeserializeFromBase64Text(imageBlob1) img.RotateFlip(RotateFlipType.Rotate90FlipNone) itemList.Add(New PropertyValueUIItem(img, New PropertyValueUIItemInvokeHandler(AddressOf Me.marginInvoke), "Test ToolTip")) End If End Sub
// PropertyValueUIHandler delegate that provides PropertyValueUIItem // objects to any properties named HorizontalMargin or VerticalMargin. private void marginPropertyValueUIHandler(System.ComponentModel.ITypeDescriptorContext context, System.ComponentModel.PropertyDescriptor propDesc, ArrayList itemList) { // A PropertyValueUIHandler added to the IPropertyValueUIService // is queried once for each property of a component and passed // a PropertyDescriptor that represents the characteristics of // the property when the Properties window is set to a new // component. A PropertyValueUIHandler can determine whether // to add a PropertyValueUIItem for the object to its ValueUIItem // list depending on the values of the PropertyDescriptor. if( propDesc.DisplayName.Equals( "HorizontalMargin" ) ) { Image img = DeserializeFromBase64Text(imageBlob1); itemList.Add( new PropertyValueUIItem( img, new PropertyValueUIItemInvokeHandler(this.marginInvoke), "Test ToolTip") ); } if( propDesc.DisplayName.Equals( "VerticalMargin" ) ) { Image img = DeserializeFromBase64Text(imageBlob1); img.RotateFlip(RotateFlipType.Rotate90FlipNone); itemList.Add( new PropertyValueUIItem( img, new PropertyValueUIItemInvokeHandler(this.marginInvoke), "Test ToolTip") ); } }
// PropertyValueUIHandler delegate that provides PropertyValueUIItem // objects to any properties named horizontalMargin or verticalMargin. void marginPropertyValueUIHandler( System::ComponentModel::ITypeDescriptorContext^ /*context*/, System::ComponentModel::PropertyDescriptor^ propDesc, ArrayList^ itemList ) { // A PropertyValueUIHandler added to the IPropertyValueUIService // is queried once for each property of a component and passed // a PropertyDescriptor that represents the characteristics of // the property when the Properties window is set to a new // component. A PropertyValueUIHandler can determine whether // to add a PropertyValueUIItem for the object to its ValueUIItem // list depending on the values of the PropertyDescriptor. if ( propDesc->DisplayName->Equals( "horizontalMargin" ) ) { Image^ img = DeserializeFromBase64Text( imageBlob1 ); itemList->Add( gcnew PropertyValueUIItem( img,gcnew PropertyValueUIItemInvokeHandler( this, &PropertyUIComponent::marginInvoke ),"Test ToolTip" ) ); } if ( propDesc->DisplayName->Equals( "verticalMargin" ) ) { Image^ img = DeserializeFromBase64Text( imageBlob1 ); img->RotateFlip( RotateFlipType::Rotate90FlipNone ); itemList->Add( gcnew PropertyValueUIItem( img,gcnew PropertyValueUIItemInvokeHandler( this, &PropertyUIComponent::marginInvoke ),"Test ToolTip" ) ); } }
// PropertyValueUIHandler delegate that provides PropertyValueUIItem // objects to any properties named HorizontalMargin or VerticalMargin. private void MarginPropertyValueUIHandler(System.ComponentModel. ITypeDescriptorContext context, System.ComponentModel. PropertyDescriptor propDesc, ArrayList itemList) { // A PropertyValueUIHandler added to the IPropertyValueUIService // is queried once for each property of a component and passed // a PropertyDescriptor that represents the characteristics of // the property when the Properties window is set to a new // component. A PropertyValueUIHandler can determine whether // to add a PropertyValueUIItem for the object to its ValueUIItem // list depending on the values of the PropertyDescriptor. if (propDesc.get_DisplayName().Equals("HorizontalMargin")) { Image img = DeserializeFromBase64Text(imageBlob1); itemList.Add(new PropertyValueUIItem(img, new PropertyValueUIItemInvokeHandler(this.MarginInvoke) , "Test ToolTip")); } if (propDesc.get_DisplayName().Equals("VerticalMargin")) { Image img = DeserializeFromBase64Text(imageBlob1); img.RotateFlip(RotateFlipType.Rotate90FlipNone); itemList.Add(new PropertyValueUIItem(img, new PropertyValueUIItemInvokeHandler(this.MarginInvoke) , "Test ToolTip")); } } //MarginPropertyValueUIHandler
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
PropertyValueUIItem プロパティ
名前 | 説明 | |
---|---|---|
| Image | [プロパティ] ウィンドウに描画する 8 × 8 ピクセルのイメージを取得します。 |
| InvokeHandler | ユーザーが項目をダブルクリックしたときに呼び出されるハンドラを取得します。 |
| ToolTip | この項目に表示する情報文字列を取得または設定します。 |
PropertyValueUIItem メソッド
名前 | 説明 | |
---|---|---|
| Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
| GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
| GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
| ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
| Reset | ユーザー インターフェイス (UI) 項目をリセットします。 |
| ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |
名前 | 説明 | |
---|---|---|
| Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
| MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |
PropertyValueUIItem メンバ
[プロパティ] ウィンドウに表示されるプロパティについて、イベント ハンドラ、ポップアップ情報文字列、プロパティを表示するためのアイコンなどの情報を提供します。
PropertyValueUIItem データ型で公開されるメンバを以下の表に示します。
名前 | 説明 | |
---|---|---|
| Image | [プロパティ] ウィンドウに描画する 8 × 8 ピクセルのイメージを取得します。 |
| InvokeHandler | ユーザーが項目をダブルクリックしたときに呼び出されるハンドラを取得します。 |
| ToolTip | この項目に表示する情報文字列を取得または設定します。 |
名前 | 説明 | |
---|---|---|
| Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
| GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
| GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
| ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
| Reset | ユーザー インターフェイス (UI) 項目をリセットします。 |
| ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |
名前 | 説明 | |
---|---|---|
| Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
| MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |
- PropertyValueUIItemのページへのリンク