次の方法で共有


ColorConverter.ConvertTo メソッド (ITypeDescriptorContext, CultureInfo, Object, Type)

指定したオブジェクトを別の型に変換します。変換前後の型として最もよく使用されるのは文字列オブジェクトです。

Overrides Overloads Public Function ConvertTo( _
   ByVal context As ITypeDescriptorContext, _   ByVal culture As CultureInfo, _   ByVal value As Object, _   ByVal destinationType As Type _) As Object
[C#]
public override object ConvertTo(ITypeDescriptorContextcontext,CultureInfoculture,objectvalue,TypedestinationType);
[C++]
public: Object* ConvertTo(ITypeDescriptorContext* context,CultureInfo* culture,Object* value,Type* destinationType);
[JScript]
public override function ConvertTo(
   context : ITypeDescriptorContext,culture : CultureInfo,value : Object,destinationType : Type) : Object;

パラメータ

  • context
    書式指定コンテキスト。このコンバータが呼び出される環境に関する追加情報を抽出するには、このオブジェクトを使用します。この値が null かどうかを常に確認してください。また、コンテキスト オブジェクトのプロパティも null を返す場合があります。
  • culture
    色を表すカルチャを指定する CultureInfo オブジェクト。
  • value
    変換対象のオブジェクト。
  • destinationType
    オブジェクトの変換後の型。

戻り値

変換後のオブジェクト。目的の型に変換できない場合、このメソッドは NotSupportedException をスローします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

ColorConverter クラス | ColorConverter メンバ | System.Drawing 名前空間 | ColorConverter.ConvertTo オーバーロードの一覧