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

戻り値
2 つの Color 構造体が異なる場合は true。それ以外の場合は false。

このメソッドは、Color 構造体の ARGB 値以外の比較も行います。また、一部の状態フラグの比較も行います。2 つの Color 構造体の ARGB 値だけを比較する場合は、ToArgb メソッドを使用します。

op_Inequality 演算子および SystemColors クラスを使ったコード例を次に示します。この例は、Button2 という名前のボタンを含んだ Windows フォームでの使用を意図してデザインされています。次のコードをフォームに貼り付け、Button2_Click メソッドをボタンの Click イベントに関連付けます。
Private Sub Button2_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button2.Click If (Color.op_Inequality(Me.BackColor, SystemColors.ControlDark)) Then Me.BackColor = SystemColors.ControlDark End If If Not (Me.Font.Bold) Then Me.Font = New Font(Me.Font, FontStyle.Bold) End If End Sub
private void Button2_Click(System.Object sender, System.EventArgs e) { if (this.BackColor != SystemColors.ControlDark) { this.BackColor = SystemColors.ControlDark; } if (!(this.Font.Bold)) { this.Font = new Font(this.Font, FontStyle.Bold); } }
void Button2_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ ) { if ( this->BackColor != SystemColors::ControlDark ) { this->BackColor = SystemColors::ControlDark; } if ( !(this->Font->Bold) ) { this->Font = gcnew System::Drawing::Font( this->Font,FontStyle::Bold ); } }
private void button2_Click(System.Object sender, System.EventArgs e) { if (!(this.get_BackColor().Equals(SystemColors.get_ControlDark()))) { this.set_BackColor(SystemColors.get_ControlDark()); } if (!(this.get_Font().get_Bold())) { this.set_Font(new Font(this.get_Font(), FontStyle.Bold)); } } //button2_Click

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


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

- Color.op_Inequality メソッドのページへのリンク