CharacterRange.Inequality(CharacterRange, CharacterRange) Operador
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Compara dois CharacterRange objetos. Obtém um valor que indica se os First valores ou Length dos dois CharacterRange objetos não são iguais.
public:
static bool operator !=(System::Drawing::CharacterRange cr1, System::Drawing::CharacterRange cr2);
public static bool operator !=(System.Drawing.CharacterRange cr1, System.Drawing.CharacterRange cr2);
static member op_Inequality : System.Drawing.CharacterRange * System.Drawing.CharacterRange -> bool
Public Shared Operator != (cr1 As CharacterRange, cr2 As CharacterRange) As Boolean
Parâmetros
- cr1
- CharacterRange
A CharacterRange para comparar a desigualdade.
- cr2
- CharacterRange
A CharacterRange para comparar a desigualdade.
Devoluções
true para indicar que os First valores ou Length dos dois CharacterRange objetos diferem; caso contrário, false.
Exemplos
O exemplo seguinte demonstra como usar o Inequality método. Para executar este exemplo, cole-o num formulário do Windows. Trate o evento do Paint formulário e chame o CharacterRangeInequality método a partir do Paint método de gestão de eventos, passando e como PaintEventArgs.
private void CharacterRangeInequality()
{
// Declare the string to draw.
string message = "Strings or strings; that is the question.";
// Compare the ranges for equality. The should not be equal.
CharacterRange range1 =
new CharacterRange(message.IndexOf("Strings"), "Strings".Length);
CharacterRange range2 =
new CharacterRange(message.IndexOf("string"), "strings".Length);
if (range1 != range2)
MessageBox.Show("The ranges are not equal.");
else
MessageBox.Show("The ranges are equal.");
}
Private Sub CharacterRangeInequality()
' Declare the string to draw.
Dim message As String = "Strings or strings; that is the question."
' Compare the ranges for equality. The should not be equal.
Dim range1 As New CharacterRange(message.IndexOf("Strings"), "Strings".Length)
Dim range2 As New CharacterRange(message.IndexOf("string"), "strings".Length)
If range1 <> range2 Then
MessageBox.Show("The ranges are not equal.")
Else
MessageBox.Show("The ranges are equal.")
End If
End Sub
Observações
O Inequality método devolve o oposto do Equality método.
O método equivalente para este operador é CharacterRange.Equals(Object)