ComboBox.ObjectCollection.IComparer<ComboBox.ObjectCollection>.Compare 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
比較兩個物件並傳回值,指出其中一個物件為小於、等於或大於另一個物件。
virtual int System.Collections.Generic.IComparer<System.Windows.Forms.ComboBox.ObjectCollection.Entry>.Compare(System::Windows::Forms::ComboBox::ObjectCollection::Entry ^ entry1, System::Windows::Forms::ComboBox::ObjectCollection::Entry ^ entry2) = System::Collections::Generic::IComparer<System::Windows::Forms::ComboBox::ObjectCollection::Entry ^>::Compare;
int IComparer<ComboBox.ObjectCollection.Entry>.Compare (System.Windows.Forms.ComboBox.ObjectCollection.Entry entry1, System.Windows.Forms.ComboBox.ObjectCollection.Entry entry2);
abstract member System.Collections.Generic.IComparer<System.Windows.Forms.ComboBox.ObjectCollection.Entry>.Compare : System.Windows.Forms.ComboBox.ObjectCollection.Entry * System.Windows.Forms.ComboBox.ObjectCollection.Entry -> int
override this.System.Collections.Generic.IComparer<System.Windows.Forms.ComboBox.ObjectCollection.Entry>.Compare : System.Windows.Forms.ComboBox.ObjectCollection.Entry * System.Windows.Forms.ComboBox.ObjectCollection.Entry -> int
Function Compare (entry1 As ComboBox.ObjectCollection.Entry, entry2 As ComboBox.ObjectCollection.Entry) As Integer Implements IComparer(Of ComboBox.ObjectCollection.Entry).Compare
參數
- entry1
- System.Windows.Forms.ComboBox.ObjectCollection.Entry
要比較的專案
- entry2
- System.Windows.Forms.ComboBox.ObjectCollection.Entry
要比較的專案。
傳回
帶正負號的整數,表示 x
和 y
的相對值,如下表所示。
值 | 意義 |
---|---|
小於零 | x 小於 y 。
|
零 | x 等於 y 。
|
大於零 | x 大於 y 。
|