tailieunhanh - Work with Data-Bound Multi-Select List Boxes Using Windows Forms It is common to have to assign

Làm việc với Danh sách Multi-Chọn Data-Bound Boxes Sử dụng Windows Forms Nó được phổ biến để có giao sản phẩm cho chủng loại, đó là một mối quan hệ một-nhiều. Đôi khi bạn muốn có thể làm điều này trong một thời trang phần nào số lượng lớn | Work with Data-Bound Multi-Select List Boxes Using Windows Forms It is common to have to assign products to categories which is a one-to-many relationship. Sometimes you want to be able to do this in a somewhat bulk fashion. One of the methods that works well is using the ListBox control. Using the ListBox control for single selections is no big deal but when it comes to using it in a multi-select method it starts getting trickier. This How-To shows you how to create an intuitive interface for assigning products to categories using a couple of multi-select list boxes on a Windows Form. You can assign a category to each product but you would like to have a method of maintaining all the products for a category at one time. How do you take advantage of a multi-select list box to perform this task Technique Using the ListBox control in regular single selection mode is as straightforward in .NET as in prior versions of Visual Basic. The same can be said in the case of using the multiselect mode of list boxes. It is as confusing in .NET as it was in prior versions. Using the ListBox control in single entry mode is pretty straightforward. You just need to use the SelectedItem property with the index of 0. However if you want to use the ListBox control in multi-select mode then you must perform some more work and access some other properties see Table . Table . Properties Having to Do with Multi-Selection on ListBox Controls In Order of Use in This How-To s Steps Property Object Description SelectionMode Property of the ListBox control. The settings for this are None One MultiSimple or MultiExtended. SelectedIndices index A collection of the ListBox control this returns the indices location in the list of all the selected items. Property of the ListBox control. A count of the number of items selected in the list box. DataRowView Object type that the data provider provides. Items index A collection of the ListBox control. Returns a .

crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.