Partager via


ToolStripComboBox.Sorted Propriété

Définition

Obtient ou définit une valeur indiquant si les éléments du fichier ToolStripComboBox sont triés.

public:
 property bool Sorted { bool get(); void set(bool value); };
public bool Sorted { get; set; }
member this.Sorted : bool with get, set
Public Property Sorted As Boolean

Valeur de propriété

true si la zone de liste modifiable est triée ; sinon, false. La valeur par défaut est false.

Exemples

L’exemple de code suivant illustre la syntaxe de définition de différentes ToolStripComboBox propriétés, y compris la Sorted propriété.

// The following code example demonstrates the syntax for setting
// various ToolStripComboBox properties.
// 
toolStripComboBox1.AutoCompleteCustomSource.AddRange(new string[] {
"aaa",
"bbb",
"ccc"});
toolStripComboBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
toolStripComboBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
toolStripComboBox1.DropDownHeight = 110;
toolStripComboBox1.DropDownWidth = 122;
toolStripComboBox1.FlatStyle = System.Windows.Forms.FlatStyle.Standard;
toolStripComboBox1.IntegralHeight = false;
toolStripComboBox1.Items.AddRange(new object[] {
"xxx",
"yyy",
"zzz"});
toolStripComboBox1.MaxDropDownItems = 9;
toolStripComboBox1.MergeAction = System.Windows.Forms.MergeAction.Insert;
toolStripComboBox1.Name = "toolStripComboBox1";
toolStripComboBox1.Size = new System.Drawing.Size(121, 25);
toolStripComboBox1.Sorted = true;
' The following code example demonstrates the syntax for setting
' various ToolStripComboBox properties.
' 
toolStripComboBox1.AutoCompleteCustomSource.AddRange(New String() {"aaa", "bbb", "ccc"})
toolStripComboBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend
toolStripComboBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource
toolStripComboBox1.DropDownHeight = 110
toolStripComboBox1.DropDownWidth = 122
toolStripComboBox1.FlatStyle = System.Windows.Forms.FlatStyle.Standard
toolStripComboBox1.IntegralHeight = False
toolStripComboBox1.Items.AddRange(New Object() {"xxx", "yyy", "zzz"})
toolStripComboBox1.MaxDropDownItems = 9
toolStripComboBox1.MergeAction = System.Windows.Forms.MergeAction.Insert
toolStripComboBox1.Name = "toolStripComboBox1"
toolStripComboBox1.Size = New System.Drawing.Size(121, 25)
toolStripComboBox1.Sorted = True

Remarques

Cette propriété spécifie si les ToolStripComboBox entrées existantes sont triées et ajoutent de nouvelles entrées à la position triée appropriée dans la liste. Vous pouvez utiliser cette propriété pour trier automatiquement les éléments dans un ToolStripComboBox. À mesure que les éléments sont ajoutés à un tri ToolStripComboBox, les éléments sont déplacés vers l’emplacement approprié dans la liste triée. Lorsque vous définissez la propriété falsesur , de nouveaux éléments sont ajoutés à la fin de la liste existante. Le tri ne respecte pas la casse et dans l’ordre alphabétique croissant.

S’applique à