ColorTranslator.ToOle メソッド
アセンブリ: System.Drawing (system.drawing.dll 内)


次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードでは、Color 構造体を OLE カラーを表す整数に変換し、メッセージ ボックスにその文字列を表示します。
Public Sub ToOle_Example(ByVal e As PaintEventArgs) ' Create an instance of a Color structure. Dim myColor As Color = Color.Green ' Translate myColor to an OLE color. Dim oleColor As Integer = ColorTranslator.ToOle(myColor) ' Show a message box with the value of htmlColor. MessageBox.Show(oleColor.ToString()) End Sub
public void ToOle_Example(PaintEventArgs e) { // Create an instance of a Color structure. Color myColor = Color.Red; // Translate myColor to an OLE color. int oleColor = ColorTranslator.ToOle(myColor); // Show a message box with the value of oleColor. MessageBox.Show(oleColor.ToString()); }
public: void ToOle_Example( PaintEventArgs^ /*e*/ ) { // Create an instance of a Color structure. Color myColor = Color::Red; // Translate myColor to an OLE color. int oleColor = ColorTranslator::ToOle( myColor ); // Show a message box with the value of oleColor. MessageBox::Show( oleColor.ToString() ); }
public void ToOle_Example(PaintEventArgs e) { // Create an instance of a Color structure. Color myColor = Color.get_Red(); // Translate myColor to an OLE color. int oleColor = ColorTranslator.ToOle(myColor); // Show a message box with the value of oleColor. MessageBox.Show(System.Convert.ToString(oleColor)); } //ToOle_Example

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からColorTranslator.ToOle メソッドを検索する場合は、下記のリンクをクリックしてください。

- ColorTranslator.ToOle メソッドのページへのリンク