Click here to Skip to main content
15,886,840 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi everyone,

I use Visual Studio 2010 and .net4.

In .Net4.5 there is a selectionMode for listBoxes as MultiExtended.
I couldnt find a equivalent attribute in .Net4.

Could you please define what can i do for multiple Selection at a time.

please note:
I have tried selection modes Multiple,Extended and Single that are available in .Net4, but unfortunatelly all of them are not available for my project

I can not download .net4.5 since i use visual studio 2010, i could not find any .Net4.5 update for visual studio 2010

Thanks
Posted
Updated 12-Nov-14 1:34am
v2

1 solution

If you are speaking of the standard Microsoft ListBox Control for WinForms available since .NET 1.1, then you are mistaken: that Control does expose a 'MultiExtended option for the 'SelectionMode property.

Edit: OP has revealed this is a question about the WPF ListBox.

The WPF ListBox provides a SelectionMode.Extended; it does not provide 'MultiExtended : I believe that the way that WPF Extended Mode functions may be different from the WinForms MultiExtended Mode funtionality, but I do not use WPF, and am not certain of that.

You can compare the WinForms MultiExtended behavior:

1. Select when Control, or Shift key is down, and mouse clicks item
2. Select when mouse is down and dragged over un-selected item

Yourself, and evaluate the difference
 
Share this answer
 
v2
Comments
denegabze 12-Nov-14 8:15am    
Yes, i am speaking about System.Windows.Controls as seen the code
this.CitiesListBox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.CitiesListBox_SelectionChanged);
written in .g.cs file created by .Net

And that is wpf ListBox create code

ListBox Height="170" HorizontalAlignment="Left" Margin="24,0,0,175" Name="CitiesListBox" VerticalAlignment="Bottom" Width="542" SelectionChanged="CitiesListBox_SelectionChanged" SelectionMode ="Extended"

In SelectionMode i can see just three options as "Single", "Multiple", "Extended".
BillWoodruff 12-Nov-14 8:31am    
Now that we know you are using WPF: see my revised post. Always a good idea to tag your question so it's clear what technology you are using.
denegabze 12-Nov-14 8:49am    
Thanks for advise billWoodruff.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900