为您找到"
listbox
"相关结果约100,000,000个
Examples. The following code example demonstrates how to create a ListBox control that displays multiple items in columns and can have more than one item selected in the control's list. The code for the example adds 50 items to the ListBox using the Add method of the ListBox.ObjectCollection class and then selects three items from the list using the SetSelected method.
In Windows Forms, the ListBox control is used to show multiple elements in a list, from which a user can select one or more elements, and the elements are generally displayed in multiple columns. The ListBox class in C# is used to represent the Windows list box and also provides different types of properties, methods, and events. It is defined under System.Windows.Forms namespace.
A Windows Forms ListBox control displays a list from which the user can select one or more items. If the total number of items exceeds the number that can be displayed, a scroll bar is automatically added to the ListBox control. When the MultiColumn property is set to true, the list box displays items in multiple columns and a horizontal scroll bar appears.
Using the ListBox Control in C# Windows Forms Introduction. The `ListBox` control in C# Windows Forms provides a simple way to display a list of items to a user, allowing them to select one or more items. This guide explains how to create and use `ListBox` controls, both during design time and dynamically at runtime. Creating a ListBox Control
Learn how to use the Tkinter Listbox widget to display and select a list of items in Python. See how to create, add, bind, and configure the Listbox widget with code and output.
Learn how to create, populate and use a Listbox in VBA code for a Worksheet or a UserForm. See how to get a selected item, clear a Listbox and link it to a cells range.
Tutorial. First, create a new Windows Forms C# project, and then open the Toolbox and double-click on the ListBox item. This will insert a new ListBox into your Windows Forms designer. If you want to use Buttons with the ListBox, add those too. Next: Right-click on the Form in the Solution Explorer, and select "View Code." You will see a C# ...
The following example swaps columns of a multicolumn ListBox.The sample uses the List property in two ways:. To access and exchange individual values in the ListBox.In this usage, List has subscripts to designate the row and column of a specified value. To initially load the ListBox with values from an array. In this usage, List has no subscripts. To use this example, copy this sample code to ...
Introduction to Listbox in C#. ListBox in C# is defined as adding a list of elements to the ListBox to operate on single or multiple elements. The difference between the drop-down box and the list box is drop-down box can select only one element at a time, but in the case of the list box, we can select single or multiple elements at a time.
ListBox controls are often used with data binding. For more information, see Data Binding Overview.. Displaying a large number of items may cause performance issues. See Optimizing Performance: Controls for more information.. Customizing the ListBox Control. To apply the same property settings to multiple ListBox controls, use the Style property. You can modify the default ControlTemplate to ...