-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
ListView.xml
7090 lines (6345 loc) · 586 KB
/
ListView.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<Type Name="ListView" FullName="System.Windows.Forms.ListView">
<TypeSignature Language="C#" Value="public class ListView : System.Windows.Forms.Control" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit ListView extends System.Windows.Forms.Control" />
<TypeSignature Language="DocId" Value="T:System.Windows.Forms.ListView" />
<TypeSignature Language="VB.NET" Value="Public Class ListView
Inherits Control" />
<TypeSignature Language="F#" Value="type ListView = class
 inherit Control" />
<TypeSignature Language="C++ CLI" Value="public ref class ListView : System::Windows::Forms::Control" />
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Windows.Forms.Control</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.ComponentModel.DefaultEvent("SelectedIndexChanged")]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.DefaultEvent("SelectedIndexChanged")>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.ComponentModel.DefaultProperty("Items")]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.DefaultProperty("Items")>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1">
<AttributeName Language="C#">[System.ComponentModel.Designer("System.Windows.Forms.Design.ListViewDesigner, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.Designer("System.Windows.Forms.Design.ListViewDesigner, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName Language="C#">[System.ComponentModel.Designer("System.Windows.Forms.Design.ListViewDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.Designer("System.Windows.Forms.Design.ListViewDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1">
<AttributeName Language="C#">[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1">
<AttributeName Language="C#">[System.Runtime.InteropServices.ComVisible(true)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.InteropServices.ComVisible(true)>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.Windows.Forms.Docking(System.Windows.Forms.DockingBehavior.Ask)]</AttributeName>
<AttributeName Language="F#">[<System.Windows.Forms.Docking(System.Windows.Forms.DockingBehavior.Ask)>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.ComponentModel.Designer("System.Windows.Forms.Design.ListViewDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.Designer("System.Windows.Forms.Design.ListViewDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="windowsdesktop-8.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(0)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(0)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Represents a Windows list view control, which displays a collection of items that can be displayed using one of four different views.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
A <xref:System.Windows.Forms.ListView> control allows you to display a list of items with item text and, optionally, an icon to identify the type of item. For example, the Windows Explorer list of files is similar in appearance to a <xref:System.Windows.Forms.ListView> control. It displays a list of the files and folders currently selected in the tree. Each file and folder displays an icon associated with it to help identify the type of file or folder. The <xref:System.Windows.Forms.ListViewItem> class represents an item within a <xref:System.Windows.Forms.ListView> control. The items that are displayed in the list can be shown in one of five different views. Items can be displayed as large icons, as small icons, or as small icons in a vertical list. Items can also have subitems which contain information that is related to the parent item. The details view allows you to display the item and its subitems in a grid with column headers that identify the information being displayed in a subitem. The tile view, which has limited availability as described below, allows you to display the item and its subitems as a tile that contains a large icon next to the textual information. <xref:System.Windows.Forms.ListView> supports single or multiple selection. The multiple selection feature lets the user select from a list of items in a way similar to a <xref:System.Windows.Forms.ListBox> control. Additionally, the user can activate selected items to perform a task. For example, you could use a <xref:System.Windows.Forms.ListView> control to display a list of files that the application can then open and utilize. The user can select the files to open and then double-click them to activate the items and open the files in the application. The <xref:System.Windows.Forms.ListView> can also display check boxes, using the <xref:System.Windows.Forms.ListView.CheckBoxes%2A> property, to allow the user to check the items that they want to perform an action on. You can use the <xref:System.Windows.Forms.ListView> control in a variety of ways. The control can be used to display information from an application, a database, or a text file. The <xref:System.Windows.Forms.ListView> can also be used to obtain information from the user, such as selecting a set of files to process.
<xref:System.Windows.Forms.ListView> provides a large number of properties that provide flexibility in appearance and behavior. The <xref:System.Windows.Forms.ListView.View%2A> property allows you to change the way in which items are displayed. The <xref:System.Windows.Forms.ListView.LargeImageList%2A>, <xref:System.Windows.Forms.ListView.SmallImageList%2A>, and <xref:System.Windows.Forms.ListView.StateImageList%2A> properties allow you to specify the <xref:System.Windows.Forms.ImageList> objects that contain the images displayed for items and, in the case of the <xref:System.Windows.Forms.ListView.StateImageList%2A>, the check boxes that are displayed when the <xref:System.Windows.Forms.ListView.CheckBoxes%2A> property is set to `true`. To determine which items are checked, you can use the <xref:System.Windows.Forms.ListView.CheckedItems%2A> property to access the <xref:System.Windows.Forms.ListView.CheckedListViewItemCollection> collection. The <xref:System.Windows.Forms.ListView.Columns%2A> property allows access to the <xref:System.Windows.Forms.ListView.ColumnHeaderCollection>, which stores the column headers that are displayed when the <xref:System.Windows.Forms.ListView.View%2A> property of the control is set to <xref:System.Windows.Forms.View.Details>. Items are added and removed from the <xref:System.Windows.Forms.ListView> through the <xref:System.Windows.Forms.ListView.Items%2A> property. The <xref:System.Windows.Forms.ListView.Items%2A> property allows you to access the <xref:System.Windows.Forms.ListView.ListViewItemCollection> of the control, which provides methods for manipulating the items in the control. If you want to allow the user to edit the text of an item, you can use the <xref:System.Windows.Forms.ListView.LabelEdit%2A> property. When your control contains a large number of items, it is often easier for the user to see them in a sorted list. You can use the <xref:System.Windows.Forms.ListView.Sorting%2A> property to sort the items alphabetically. You can also completely customize the appearance of a <xref:System.Windows.Forms.ListView> control. To do this, set the <xref:System.Windows.Forms.ListView.OwnerDraw%2A> property to `true` and handle one or more of the following events: <xref:System.Windows.Forms.ListView.DrawItem>, <xref:System.Windows.Forms.ListView.DrawSubItem>, <xref:System.Windows.Forms.ListView.DrawColumnHeader>.
Many of the properties of the <xref:System.Windows.Forms.ListView> control are used when the <xref:System.Windows.Forms.ListView.View%2A> property of the control is set to <xref:System.Windows.Forms.View.Details>. The <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A> property allows the user of your <xref:System.Windows.Forms.ListView> control to reconfigure the order of columns at run time. The <xref:System.Windows.Forms.ListView.FullRowSelect%2A> property allows an item and its subitems to be selected instead of just the item. To display gridlines in the details view to identify the boundaries of items and subitems in the <xref:System.Windows.Forms.ListView>, you can use the <xref:System.Windows.Forms.ListView.GridLines%2A> property. The <xref:System.Windows.Forms.ListView.HeaderStyle%2A> property allows you to specify the type of column headers to display.
A <xref:System.Windows.Forms.ListView> control can operate in virtual mode, where <xref:System.Windows.Forms.ListViewItem> objects are generated dynamically instead of being stored in the <xref:System.Windows.Forms.ListView.Items%2A> collection. This can be useful for dealing with very large lists or lists whose contents frequently change. To enable Virtual mode, set the <xref:System.Windows.Forms.ListView.VirtualMode%2A> property to `true` and handle the <xref:System.Windows.Forms.ListView.RetrieveVirtualItem>, <xref:System.Windows.Forms.ListView.CacheVirtualItems>, and <xref:System.Windows.Forms.ListView.SearchForVirtualItem> events.
In addition to the many properties that are available for a <xref:System.Windows.Forms.ListView> control, there are methods and events that your application can use to provide additional capabilities to the <xref:System.Windows.Forms.ListView>. The <xref:System.Windows.Forms.ListView.BeginUpdate%2A> and <xref:System.Windows.Forms.ListView.EndUpdate%2A> methods allow you to improve performance when you add many items to a <xref:System.Windows.Forms.ListView> by preventing the control from repainting every time that an item is added. If your <xref:System.Windows.Forms.ListView> control is displaying items and subitems, you may want to provide functionality when the user right-clicks a subitem. To determine the item whose subitem is being clicked, you can use the <xref:System.Windows.Forms.ListView.GetItemAt%2A> method. When performing validation of the items after the user has edited them, you may want to display a specific item to the user to change. The <xref:System.Windows.Forms.ListView.EnsureVisible%2A> method can be called to ensure that the specific item is in the visible area of the control.
If the <xref:System.Windows.Forms.ListView.LabelEdit%2A> property set to `true`, you can perform tasks such as validating the text being edited before and after the text changed by creating an event handler for the <xref:System.Windows.Forms.ListView.BeforeLabelEdit> and <xref:System.Windows.Forms.ListView.AfterLabelEdit> events. To perform tasks such as opening a file or displaying a dialog box to edit an item displayed in a <xref:System.Windows.Forms.ListView>, you can create an event handler for the <xref:System.Windows.Forms.ListView.ItemActivate> event. If you allow the user to sort the items in a <xref:System.Windows.Forms.ListView> when they click a column header, you can create an event handler for the <xref:System.Windows.Forms.ListView.ColumnClick> event to perform the sorting. When the <xref:System.Windows.Forms.ListView.CheckBoxes%2A> property is set to `true`, you can determine when a change in an item's check state has occurred by handling the <xref:System.Windows.Forms.ListView.ItemCheck> event.
You can also set a background image for the <xref:System.Windows.Forms.ListView> with the <xref:System.Windows.Forms.Control.BackgroundImage%2A> property. Your application must have the <xref:System.STAThreadAttribute> on its `Main` method to correctly display the background image for the <xref:System.Windows.Forms.ListView> control. In addition, if a <xref:System.Windows.Forms.ListView> control with a background image is hosted in Internet Explorer, specify comctl32.dll version 6.0 as a dependent assembly in the application manifest file to ensure the background image is properly displayed.
Windows XP and Windows Server 2003 provide three features that enhance the <xref:System.Windows.Forms.ListView> control when your application calls the <xref:System.Windows.Forms.Application.EnableVisualStyles%2A?displayProperty=nameWithType> method: tile view, grouping, and the insertion mark.
The tile view lets you balance graphical and textual information by displaying item and subitem text next to large icons. Set the <xref:System.Windows.Forms.ListView.View%2A> property to <xref:System.Windows.Forms.View.Tile?displayProperty=nameWithType> to enable this behavior.
The grouping feature lets you visually group items into related categories. Use the <xref:System.Windows.Forms.ListView.Groups%2A> property to add <xref:System.Windows.Forms.ListViewGroup> objects to the <xref:System.Windows.Forms.ListView> control when you want to enable this feature. To temporarily disable the feature, set the <xref:System.Windows.Forms.ListView.ShowGroups%2A> property to `false`.
The insertion mark feature lets you provide drag-and-drop item repositioning with visual feedback to indicate drop locations. Use the <xref:System.Windows.Forms.ListViewInsertionMark> object retrieved through the <xref:System.Windows.Forms.ListView.InsertionMark%2A> property to display the insertion mark.
These features are available only under Windows XP and Windows Server 2003. On earlier operating systems, the code that relate to these features has no effect, the tile view appears as the large icon view, and the insertion mark and groups do not display. In some cases, you might want to include code that determines whether these features are available, and provide alternate functionality when they are unavailable. These features are provided by the same library that provides the operating system themes feature. To check for the availability of this library, call the <xref:System.Windows.Forms.FeatureSupport.IsPresent%28System.Object%29?displayProperty=nameWithType> method overload and pass in the <xref:System.Windows.Forms.OSFeature.Themes?displayProperty=nameWithType> value.
The following table shows some of the <xref:System.Windows.Forms.ListView> members and the views they are valid in.
|ListView member|View|
|---------------------|----------|
|<xref:System.Windows.Forms.ListView.Alignment%2A> property|<xref:System.Windows.Forms.View.SmallIcon> or <xref:System.Windows.Forms.View.LargeIcon>|
|<xref:System.Windows.Forms.ListView.AutoArrange%2A> property|<xref:System.Windows.Forms.View.SmallIcon> or <xref:System.Windows.Forms.View.LargeIcon>|
|<xref:System.Windows.Forms.ListView.AutoResizeColumn%2A> method|<xref:System.Windows.Forms.View.Details>|
|<xref:System.Windows.Forms.ListView.Columns%2A> property|<xref:System.Windows.Forms.View.Details> or <xref:System.Windows.Forms.View.Tile>|
|<xref:System.Windows.Forms.ListView.DrawSubItem> event|<xref:System.Windows.Forms.View.Details>|
|<xref:System.Windows.Forms.ListView.FindItemWithText%2A> method|<xref:System.Windows.Forms.View.Details>, <xref:System.Windows.Forms.View.List>, or <xref:System.Windows.Forms.View.Tile>|
|<xref:System.Windows.Forms.ListView.FindNearestItem%2A> method|<xref:System.Windows.Forms.View.SmallIcon> or <xref:System.Windows.Forms.View.LargeIcon>|
|<xref:System.Windows.Forms.ListView.GetItemAt%2A> method|<xref:System.Windows.Forms.View.Details> or <xref:System.Windows.Forms.View.Tile>|
|<xref:System.Windows.Forms.ListView.Groups%2A> property|All views except <xref:System.Windows.Forms.View.List>|
|<xref:System.Windows.Forms.ListView.HeaderStyle%2A> property|<xref:System.Windows.Forms.View.Details>|
|<xref:System.Windows.Forms.ListView.InsertionMark%2A> property|<xref:System.Windows.Forms.View.LargeIcon>, <xref:System.Windows.Forms.View.SmallIcon>, or <xref:System.Windows.Forms.View.Tile>|
## Examples
The following code example creates a <xref:System.Windows.Forms.ListView> control with three <xref:System.Windows.Forms.ListViewItem> objects specified and three <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects specified for each item. The example also creates <xref:System.Windows.Forms.ColumnHeader> objects to display the subitems in details view. Two <xref:System.Windows.Forms.ImageList> objects are also created in the code example to provide images for the <xref:System.Windows.Forms.ListViewItem> objects. These <xref:System.Windows.Forms.ImageList> objects are added to the <xref:System.Windows.Forms.ListView.LargeImageList%2A> and <xref:System.Windows.Forms.ListView.SmallImageList%2A> properties. The example uses the following properties in creating the <xref:System.Windows.Forms.ListView> control:
- <xref:System.Windows.Forms.ListView.View%2A>
- <xref:System.Windows.Forms.ListView.LabelEdit%2A>
- <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A>
- <xref:System.Windows.Forms.ListView.CheckBoxes%2A>
- <xref:System.Windows.Forms.ListView.FullRowSelect%2A>
- <xref:System.Windows.Forms.ListView.GridLines%2A>
- <xref:System.Windows.Forms.ListView.Sorting%2A>
This example requires that you have added the code to a <xref:System.Windows.Forms.Form> and call the method created in the example from the constructor or another method on the form. The example also requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ListViewExample/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView+ColumnHeaderCollection/Add/form1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.ListViewItem" />
<altmember cref="T:System.Windows.Forms.ImageList" />
<altmember cref="M:System.Windows.Forms.Application.EnableVisualStyles" />
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ListView ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 ListView();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ListView" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example creates a <xref:System.Windows.Forms.ListView> control with three <xref:System.Windows.Forms.ListViewItem> objects specified and three <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects specified for each item. The example also creates <xref:System.Windows.Forms.ColumnHeader> objects to display the subitems in details view. Two <xref:System.Windows.Forms.ImageList> objects are also created in the code example to provide images for the <xref:System.Windows.Forms.ListViewItem> objects. These <xref:System.Windows.Forms.ImageList> objects are added to the <xref:System.Windows.Forms.ListView.LargeImageList%2A> and <xref:System.Windows.Forms.ListView.SmallImageList%2A> properties. The example uses the following properties in creating the <xref:System.Windows.Forms.ListView> control:
- <xref:System.Windows.Forms.ListView.View%2A>
- <xref:System.Windows.Forms.ListView.LabelEdit%2A>
- <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A>
- <xref:System.Windows.Forms.ListView.CheckBoxes%2A>
- <xref:System.Windows.Forms.ListView.FullRowSelect%2A>
- <xref:System.Windows.Forms.ListView.GridLines%2A>
- <xref:System.Windows.Forms.ListView.Sorting%2A>
This example requires that you have added the code to a <xref:System.Windows.Forms.Form> and call the method created in the example from the constructor or another method on the form. The example also requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ListViewExample/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView+ColumnHeaderCollection/Add/form1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb" id="Snippet1":::
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Activation">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ItemActivation Activation { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.ItemActivation Activation" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.Activation" />
<MemberSignature Language="VB.NET" Value="Public Property Activation As ItemActivation" />
<MemberSignature Language="F#" Value="member this.Activation : System.Windows.Forms.ItemActivation with get, set" Usage="System.Windows.Forms.ListView.Activation" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Windows::Forms::ItemActivation Activation { System::Windows::Forms::ItemActivation get(); void set(System::Windows::Forms::ItemActivation value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.ComponentModel.DefaultValue(System.Windows.Forms.ItemActivation.Standard)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.DefaultValue(System.Windows.Forms.ItemActivation.Standard)>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.ItemActivation</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the type of action the user must take to activate an item.</summary>
<value>One of the <see cref="T:System.Windows.Forms.ItemActivation" /> values. The default is <see cref="F:System.Windows.Forms.ItemActivation.Standard" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.Activation%2A> property allows you to specify how the user will activate an item in the <xref:System.Windows.Forms.ListView> control. Activating an item in a <xref:System.Windows.Forms.ListView> differs from just selecting an item. When an item is activated, an action is typically performed in an event handler for the <xref:System.Windows.Forms.ListView.ItemActivate> event. For example, when an item is activated you might open a file or display a dialog box that allows the item to be edited. Typically, an item is double-clicked by the user to activate it. If the <xref:System.Windows.Forms.ListView.Activation%2A> property is set to <xref:System.Windows.Forms.ItemActivation.OneClick>, clicking the item one time activates it. Setting the <xref:System.Windows.Forms.ListView.Activation%2A> property to <xref:System.Windows.Forms.ItemActivation.TwoClick> differs from the standard double-click because the two clicks can have any duration between them.
> [!NOTE]
> If the <xref:System.Windows.Forms.ListView.Activation%2A> property is set to <xref:System.Windows.Forms.ItemActivation.OneClick> or <xref:System.Windows.Forms.ItemActivation.TwoClick>, label editing will not be allowed regardless of the value of the <xref:System.Windows.Forms.ListView.LabelEdit%2A> property.
]]></format>
</remarks>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value specified is not one of the <see cref="T:System.Windows.Forms.ItemActivation" /> members.</exception>
<altmember cref="T:System.Windows.Forms.ItemActivation" />
<altmember cref="E:System.Windows.Forms.ListView.ItemActivate" />
</Docs>
</Member>
<Member MemberName="AfterLabelEdit">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.LabelEditEventHandler AfterLabelEdit;" FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0;windowsdesktop-6.0" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.LabelEditEventHandler AfterLabelEdit" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.ListView.AfterLabelEdit" />
<MemberSignature Language="VB.NET" Value="Public Custom Event AfterLabelEdit As LabelEditEventHandler " />
<MemberSignature Language="F#" Value="member this.AfterLabelEdit : System.Windows.Forms.LabelEditEventHandler " Usage="member this.AfterLabelEdit : System.Windows.Forms.LabelEditEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:
 event System::Windows::Forms::LabelEditEventHandler ^ AfterLabelEdit;" />
<MemberSignature Language="C#" Value="public event System.Windows.Forms.LabelEditEventHandler? AfterLabelEdit;" FrameworkAlternate="windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0" />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.LabelEditEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the label for an item is edited by the user.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.AfterLabelEdit> event occurs when the user finishes modifying the text for an item. The new string that the user types for the item is passed to the event, and the event handler can reject the change. If the event handler rejects the change, the text reverts to the text as it was before the user began editing the item.
> [!NOTE]
> Because the <xref:System.Windows.Forms.ListView.AfterLabelEdit?displayProperty=nameWithType> event takes place before the label edit is committed, calling the <xref:System.Windows.Forms.ListView.Sort%2A?displayProperty=nameWithType> method in a handler for this event will sort the item using the original value.
In order for the <xref:System.Windows.Forms.ListView.AfterLabelEdit> event to be raised, the <xref:System.Windows.Forms.ListView.LabelEdit%2A> property of the <xref:System.Windows.Forms.ListView> control must be set to `true`.
You can create an event handler for the <xref:System.Windows.Forms.ListView.BeforeLabelEdit> event to perform tasks before the user edits the text of an item.
For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.ListView.AfterLabelEdit> event to restrict a newly edited label to characters in the alphabet. The example uses the <xref:System.Text.ASCIIEncoding> class to obtain the ASCII character code of each character of the new label. If the character falls between the ASCII codes that represent numbers, the new label cannot be applied to the item. This example requires that you have created a <xref:System.Windows.Forms.ListView> control on a form and added items to it. The example also requires that you have connected the <xref:System.Windows.Forms.ListView.AfterLabelEdit> event to the event handler defined in the example code. In order to use the <xref:System.Text.ASCIIEncoding> class, your file must include the <xref:System.Text> namespace.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ListView.AfterLabelEdit/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView/AfterLabelEdit/form1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListView.AfterLabelEdit/VB/form1.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.ListView.OnAfterLabelEdit(System.Windows.Forms.LabelEditEventArgs)" />
<altmember cref="E:System.Windows.Forms.ListView.BeforeLabelEdit" />
<altmember cref="T:System.Windows.Forms.LabelEditEventHandler" />
<altmember cref="P:System.Windows.Forms.ListView.LabelEdit" />
</Docs>
</Member>
<Member MemberName="Alignment">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ListViewAlignment Alignment { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.ListViewAlignment Alignment" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.Alignment" />
<MemberSignature Language="VB.NET" Value="Public Property Alignment As ListViewAlignment" />
<MemberSignature Language="F#" Value="member this.Alignment : System.Windows.Forms.ListViewAlignment with get, set" Usage="System.Windows.Forms.ListView.Alignment" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Windows::Forms::ListViewAlignment Alignment { System::Windows::Forms::ListViewAlignment get(); void set(System::Windows::Forms::ListViewAlignment value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.ComponentModel.DefaultValue(System.Windows.Forms.ListViewAlignment.Top)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.DefaultValue(System.Windows.Forms.ListViewAlignment.Top)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.ComponentModel.Localizable(true)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.Localizable(true)>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.ListViewAlignment</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the alignment of items in the control.</summary>
<value>One of the <see cref="T:System.Windows.Forms.ListViewAlignment" /> values. The default is <see cref="F:System.Windows.Forms.ListViewAlignment.Top" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.Alignment%2A> property only affects alignment when the <xref:System.Windows.Forms.ListView.View%2A> property is set to <xref:System.Windows.Forms.View.LargeIcon> or <xref:System.Windows.Forms.View.SmallIcon>.
> [!NOTE]
> This property has no effect with the <xref:System.Windows.Forms.ListView.View%2A> property is set to <xref:System.Windows.Forms.View.List>.
]]></format>
</remarks>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value specified is not one of the <see cref="T:System.Windows.Forms.ListViewAlignment" /> values.</exception>
<altmember cref="T:System.Windows.Forms.ListViewAlignment" />
</Docs>
</Member>
<Member MemberName="AllowColumnReorder">
<MemberSignature Language="C#" Value="public bool AllowColumnReorder { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool AllowColumnReorder" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.AllowColumnReorder" />
<MemberSignature Language="VB.NET" Value="Public Property AllowColumnReorder As Boolean" />
<MemberSignature Language="F#" Value="member this.AllowColumnReorder : bool with get, set" Usage="System.Windows.Forms.ListView.AllowColumnReorder" />
<MemberSignature Language="C++ CLI" Value="public:
 property bool AllowColumnReorder { bool get(); void set(bool value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.ComponentModel.DefaultValue(false)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.DefaultValue(false)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the user can drag column headers to reorder columns in the control.</summary>
<value>
<see langword="true" /> if drag-and-drop column reordering is allowed; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Setting the value of the <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A> property has no effect unless the <xref:System.Windows.Forms.ListView.View%2A> property is set to <xref:System.Windows.Forms.View.Details>. You can use this property to allow users to reposition columns in the control at run time. When the <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A> property is set to `true`, users can position the columns in the control to display the item and its subitems in a way that meets their needs within your application.
## Examples
The following code example creates a <xref:System.Windows.Forms.ListView> control with three <xref:System.Windows.Forms.ListViewItem> objects specified and three <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects specified for each item. The example also creates <xref:System.Windows.Forms.ColumnHeader> objects to display the subitems in details view. Two <xref:System.Windows.Forms.ImageList> objects are also created in the code example to provide images for the <xref:System.Windows.Forms.ListViewItem> objects. These <xref:System.Windows.Forms.ImageList> objects are added to the <xref:System.Windows.Forms.ListView.LargeImageList%2A> and <xref:System.Windows.Forms.ListView.SmallImageList%2A> properties. The example uses the following properties in creating the <xref:System.Windows.Forms.ListView> control:
- <xref:System.Windows.Forms.ListView.View%2A>
- <xref:System.Windows.Forms.ListView.LabelEdit%2A>
- <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A>
- <xref:System.Windows.Forms.ListView.CheckBoxes%2A>
- <xref:System.Windows.Forms.ListView.FullRowSelect%2A>
- <xref:System.Windows.Forms.ListView.GridLines%2A>
- <xref:System.Windows.Forms.ListView.Sorting%2A>
This example requires that you have added the code to a <xref:System.Windows.Forms.Form> and call the method created in the example from the constructor or another method on the form. The example also requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ListViewExample/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView+ColumnHeaderCollection/Add/form1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.ListView.View" />
<altmember cref="T:System.Windows.Forms.View" />
</Docs>
</Member>
<MemberGroup MemberName="ArrangeIcons">
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Arranges items in the control when they are displayed as icons.</summary>
</Docs>
</MemberGroup>
<Member MemberName="ArrangeIcons">
<MemberSignature Language="C#" Value="public void ArrangeIcons ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void ArrangeIcons() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.ArrangeIcons" />
<MemberSignature Language="VB.NET" Value="Public Sub ArrangeIcons ()" />
<MemberSignature Language="F#" Value="member this.ArrangeIcons : unit -> unit" Usage="listView.ArrangeIcons " />
<MemberSignature Language="C++ CLI" Value="public:
 void ArrangeIcons();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Arranges items in the control when they are displayed as icons based on the value of the <see cref="P:System.Windows.Forms.ListView.Alignment" /> property.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.ArrangeIcons%2A> method is only useful when the <xref:System.Windows.Forms.ListView.View%2A> property is set to <xref:System.Windows.Forms.View.LargeIcon> or <xref:System.Windows.Forms.View.SmallIcon>. Calling this version of the <xref:System.Windows.Forms.ListView.ArrangeIcons%2A> method arranges the items based on the value of the <xref:System.Windows.Forms.ListView.Alignment%2A> property. To cause the items to be aligned based on a value that differs from that of the <xref:System.Windows.Forms.ListView.Alignment%2A> property, use the other version of the <xref:System.Windows.Forms.ListView.ArrangeIcons%2A> method.
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.ListView.Alignment" />
</Docs>
</Member>
<Member MemberName="ArrangeIcons">
<MemberSignature Language="C#" Value="public void ArrangeIcons (System.Windows.Forms.ListViewAlignment value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void ArrangeIcons(valuetype System.Windows.Forms.ListViewAlignment value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.ArrangeIcons(System.Windows.Forms.ListViewAlignment)" />
<MemberSignature Language="VB.NET" Value="Public Sub ArrangeIcons (value As ListViewAlignment)" />
<MemberSignature Language="F#" Value="member this.ArrangeIcons : System.Windows.Forms.ListViewAlignment -> unit" Usage="listView.ArrangeIcons value" />
<MemberSignature Language="C++ CLI" Value="public:
 void ArrangeIcons(System::Windows::Forms::ListViewAlignment value);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Windows.Forms.ListViewAlignment" />
</Parameters>
<Docs>
<param name="value">One of the <see cref="T:System.Windows.Forms.ListViewAlignment" /> values.</param>
<summary>Arranges items in the control when they are displayed as icons with a specified alignment setting.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.ArrangeIcons%2A> method is only useful when the <xref:System.Windows.Forms.ListView.View%2A> property is set to <xref:System.Windows.Forms.View.LargeIcon> or <xref:System.Windows.Forms.View.SmallIcon>. This version of the <xref:System.Windows.Forms.ListView.ArrangeIcons%2A> method arranges the icons in the <xref:System.Windows.Forms.ListView> based on the <xref:System.Windows.Forms.ListViewAlignment> value specified in the `value` parameter. Calling this method does not change the value of the <xref:System.Windows.Forms.ListView.Alignment%2A> property of the control. This method is used to arrange icons on the control using a different value than that of the <xref:System.Windows.Forms.ListView.Alignment%2A> property. To cause the items to be aligned based on the value of the <xref:System.Windows.Forms.ListView.Alignment%2A> property, use the other version of the <xref:System.Windows.Forms.ListView.ArrangeIcons%2A> method.
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The value specified in the <paramref name="value" /> parameter is not a member of the <see cref="T:System.Windows.Forms.ListViewAlignment" /> enumeration.</exception>
<altmember cref="T:System.Windows.Forms.ListViewAlignment" />
<altmember cref="P:System.Windows.Forms.ListView.Alignment" />
</Docs>
</Member>
<Member MemberName="AutoArrange">
<MemberSignature Language="C#" Value="public bool AutoArrange { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool AutoArrange" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.AutoArrange" />
<MemberSignature Language="VB.NET" Value="Public Property AutoArrange As Boolean" />
<MemberSignature Language="F#" Value="member this.AutoArrange : bool with get, set" Usage="System.Windows.Forms.ListView.AutoArrange" />
<MemberSignature Language="C++ CLI" Value="public:
 property bool AutoArrange { bool get(); void set(bool value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.ComponentModel.DefaultValue(true)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.DefaultValue(true)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets whether icons are automatically kept arranged.</summary>
<value>
<see langword="true" /> if icons are automatically kept arranged and snapped to the grid; otherwise, <see langword="false" />. The default is <see langword="true" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.AutoArrange%2A> property only arranges items in the <xref:System.Windows.Forms.ListView> control when the <xref:System.Windows.Forms.ListView.View%2A> property is set to <xref:System.Windows.Forms.View.LargeIcon> or <xref:System.Windows.Forms.View.SmallIcon>. To change the alignment of items in the <xref:System.Windows.Forms.ListView> control, use the <xref:System.Windows.Forms.ListView.Alignment%2A> property. You can use <xref:System.Windows.Forms.ListView.AutoArrange%2A> to ensure that all items in your <xref:System.Windows.Forms.ListView> control are automatically arranged to avoid overlapping at run time.
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.ListView.Alignment" />
</Docs>
</Member>
<Member MemberName="AutoResizeColumn">
<MemberSignature Language="C#" Value="public void AutoResizeColumn (int columnIndex, System.Windows.Forms.ColumnHeaderAutoResizeStyle headerAutoResize);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AutoResizeColumn(int32 columnIndex, valuetype System.Windows.Forms.ColumnHeaderAutoResizeStyle headerAutoResize) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.AutoResizeColumn(System.Int32,System.Windows.Forms.ColumnHeaderAutoResizeStyle)" />
<MemberSignature Language="VB.NET" Value="Public Sub AutoResizeColumn (columnIndex As Integer, headerAutoResize As ColumnHeaderAutoResizeStyle)" />
<MemberSignature Language="F#" Value="member this.AutoResizeColumn : int * System.Windows.Forms.ColumnHeaderAutoResizeStyle -> unit" Usage="listView.AutoResizeColumn (columnIndex, headerAutoResize)" />
<MemberSignature Language="C++ CLI" Value="public:
 void AutoResizeColumn(int columnIndex, System::Windows::Forms::ColumnHeaderAutoResizeStyle headerAutoResize);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="columnIndex" Type="System.Int32" Index="0" FrameworkAlternate="net-5.0;net-6.0;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;netframework-4.8.1;windowsdesktop-8.0;windowsdesktop-9.0" />
<Parameter Name="headerAutoResize" Type="System.Windows.Forms.ColumnHeaderAutoResizeStyle" Index="1" FrameworkAlternate="net-5.0;net-6.0;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;netframework-4.8.1;windowsdesktop-8.0;windowsdesktop-9.0" />
</Parameters>
<Docs>
<param name="columnIndex">The zero-based index of the column to resize.</param>
<param name="headerAutoResize">One of the <see cref="T:System.Windows.Forms.ColumnHeaderAutoResizeStyle" /> values.</param>
<summary>Resizes the width of the given column as indicated by the resize style.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Calling this method is only effective once the <xref:System.Windows.Forms.ListView> and containing <xref:System.Windows.Forms.Form> have been constructed, and the <xref:System.Windows.Forms.ListView> column headers and columns are populated with items. If new items are added to the <xref:System.Windows.Forms.ListView>, the columns will not resize unless <xref:System.Windows.Forms.ListView.AutoResizeColumn%2A> is called again.
## Examples
The following example initializes a <xref:System.Windows.Forms.ListView> in detail view and automatically resizes the columns using the <xref:System.Windows.Forms.ListView.AutoResizeColumn%2A> method. To run this example, paste this code into a Windows Form and call the `InitializeResizingListView` method from the form's constructor or <xref:System.Windows.Forms.Form.Load> event handler.
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView/AutoResizeColumn/form1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewWhidbeyProperties/VB/form1.vb" id="Snippet1":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="columnIndex" /> is greater than 0 when <see cref="P:System.Windows.Forms.ListView.Columns" /> is <see langword="null" />
-or-
<paramref name="columnIndex" /> is less than 0 or greater than the number of columns set.</exception>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">
<paramref name="headerAutoResize" /> is not a member of the <see cref="T:System.Windows.Forms.ColumnHeaderAutoResizeStyle" /> enumeration.</exception>
</Docs>
</Member>
<Member MemberName="AutoResizeColumns">
<MemberSignature Language="C#" Value="public void AutoResizeColumns (System.Windows.Forms.ColumnHeaderAutoResizeStyle headerAutoResize);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AutoResizeColumns(valuetype System.Windows.Forms.ColumnHeaderAutoResizeStyle headerAutoResize) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.AutoResizeColumns(System.Windows.Forms.ColumnHeaderAutoResizeStyle)" />
<MemberSignature Language="VB.NET" Value="Public Sub AutoResizeColumns (headerAutoResize As ColumnHeaderAutoResizeStyle)" />
<MemberSignature Language="F#" Value="member this.AutoResizeColumns : System.Windows.Forms.ColumnHeaderAutoResizeStyle -> unit" Usage="listView.AutoResizeColumns headerAutoResize" />
<MemberSignature Language="C++ CLI" Value="public:
 void AutoResizeColumns(System::Windows::Forms::ColumnHeaderAutoResizeStyle headerAutoResize);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="headerAutoResize" Type="System.Windows.Forms.ColumnHeaderAutoResizeStyle" Index="0" FrameworkAlternate="net-5.0;net-6.0;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;netframework-4.8.1;windowsdesktop-8.0;windowsdesktop-9.0" />
</Parameters>
<Docs>
<param name="headerAutoResize">One of the <see cref="T:System.Windows.Forms.ColumnHeaderAutoResizeStyle" /> values.</param>
<summary>Resizes the width of the columns as indicated by the resize style.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Calling this method is only effective once the <xref:System.Windows.Forms.ListView> and containing <xref:System.Windows.Forms.Form> have been constructed, and the <xref:System.Windows.Forms.ListView> column headers and columns are populated with items. If new items are added to the <xref:System.Windows.Forms.ListView>, the columns will not resize unless <xref:System.Windows.Forms.ListView.AutoResizeColumns%2A> is called again.
## Examples
The following code example demonstrates initializing a <xref:System.Windows.Forms.ListView> in detail view and automatically resizing the columns using the <xref:System.Windows.Forms.ListView.AutoResizeColumns%2A> method. To run this example, paste this code into a Windows Form and call the `InitializeResizingListView2` method from the form's constructor or <xref:System.Windows.Forms.Form.Load> event handler.
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView/AutoResizeColumn/form1.cs" id="Snippet9":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewWhidbeyProperties/VB/form1.vb" id="Snippet9":::
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
<see cref="M:System.Windows.Forms.ListView.AutoResizeColumn(System.Int32,System.Windows.Forms.ColumnHeaderAutoResizeStyle)" /> is called with a value other than <see cref="F:System.Windows.Forms.ColumnHeaderAutoResizeStyle.None" /> when <see cref="P:System.Windows.Forms.ListView.View" /> is not set to <see cref="F:System.Windows.Forms.View.Details" />.</exception>
</Docs>
</Member>
<Member MemberName="BackColor">
<MemberSignature Language="C#" Value="public override System.Drawing.Color BackColor { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Color BackColor" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.BackColor" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property BackColor As Color" />
<MemberSignature Language="F#" Value="member this.BackColor : System.Drawing.Color with get, set" Usage="System.Windows.Forms.ListView.BackColor" />
<MemberSignature Language="C++ CLI" Value="public:
 virtual property System::Drawing::Color BackColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Color</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the background color.</summary>
<value>The <see cref="T:System.Drawing.Color" /> of the background.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="BackgroundImage">
<MemberSignature Language="C#" Value="public override System.Drawing.Image BackgroundImage { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Drawing.Image BackgroundImage" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.BackgroundImage" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property BackgroundImage As Image" />
<MemberSignature Language="F#" Value="member this.BackgroundImage : System.Drawing.Image with get, set" Usage="System.Windows.Forms.ListView.BackgroundImage" />
<MemberSignature Language="C++ CLI" Value="public:
 virtual property System::Drawing::Image ^ BackgroundImage { System::Drawing::Image ^ get(); void set(System::Drawing::Image ^ value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-1.1">
<AttributeName Language="C#">[System.ComponentModel.Browsable(false)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.Browsable(false)>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1">
<AttributeName Language="C#">[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Drawing.Image</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the background image displayed in this <see cref="T:System.Windows.Forms.ListView" /> control.</summary>
<value>The image to display in the background of the control.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="BackgroundImageChanged">
<MemberSignature Language="C#" Value="public event EventHandler BackgroundImageChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler BackgroundImageChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.ListView.BackgroundImageChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event BackgroundImageChanged As EventHandler " />
<MemberSignature Language="F#" Value="member this.BackgroundImageChanged : EventHandler " Usage="member this.BackgroundImageChanged : System.EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:
 event EventHandler ^ BackgroundImageChanged;" />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-1.1">
<AttributeName Language="C#">[System.ComponentModel.Browsable(false)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.Browsable(false)>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1">
<AttributeName Language="C#">[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the value of the <see cref="P:System.Windows.Forms.ListView.BackgroundImage" /> property changes.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="BackgroundImageLayout">
<MemberSignature Language="C#" Value="public override System.Windows.Forms.ImageLayout BackgroundImageLayout { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.ImageLayout BackgroundImageLayout" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.BackgroundImageLayout" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property BackgroundImageLayout As ImageLayout" />
<MemberSignature Language="F#" Value="member this.BackgroundImageLayout : System.Windows.Forms.ImageLayout with get, set" Usage="System.Windows.Forms.ListView.BackgroundImageLayout" />
<MemberSignature Language="C++ CLI" Value="public:
 virtual property System::Windows::Forms::ImageLayout BackgroundImageLayout { System::Windows::Forms::ImageLayout get(); void set(System::Windows::Forms::ImageLayout value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.ComponentModel.Browsable(false)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.Browsable(false)>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.ImageLayout</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets an <see cref="T:System.Windows.Forms.ImageLayout" /> value.</summary>
<value>One of the <see cref="T:System.Windows.Forms.ImageLayout" /> values.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property has no effect on the layout of the background image of the <xref:System.Windows.Forms.ListView> control, therefore it is not shown in the designer or by IntelliSense.
]]></format>
</remarks>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value specified is not one of the <see cref="T:System.Windows.Forms.ImageLayout" /> values.</exception>
</Docs>
</Member>
<Member MemberName="BackgroundImageLayoutChanged">
<MemberSignature Language="C#" Value="public event EventHandler BackgroundImageLayoutChanged;" FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0;windowsdesktop-6.0" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler BackgroundImageLayoutChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.ListView.BackgroundImageLayoutChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event BackgroundImageLayoutChanged As EventHandler " />
<MemberSignature Language="F#" Value="member this.BackgroundImageLayoutChanged : EventHandler " Usage="member this.BackgroundImageLayoutChanged : System.EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:
 event EventHandler ^ BackgroundImageLayoutChanged;" />
<MemberSignature Language="C#" Value="public event EventHandler? BackgroundImageLayoutChanged;" FrameworkAlternate="windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0" />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.ComponentModel.Browsable(false)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.Browsable(false)>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see cref="P:System.Windows.Forms.ListView.BackgroundImageLayout" /> property changes.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="BackgroundImageTiled">
<MemberSignature Language="C#" Value="public bool BackgroundImageTiled { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool BackgroundImageTiled" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.BackgroundImageTiled" />
<MemberSignature Language="VB.NET" Value="Public Property BackgroundImageTiled As Boolean" />
<MemberSignature Language="F#" Value="member this.BackgroundImageTiled : bool with get, set" Usage="System.Windows.Forms.ListView.BackgroundImageTiled" />
<MemberSignature Language="C++ CLI" Value="public:
 property bool BackgroundImageTiled { bool get(); void set(bool value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.ComponentModel.DefaultValue(false)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.DefaultValue(false)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the background image of the <see cref="T:System.Windows.Forms.ListView" /> should be tiled.</summary>
<value>
<see langword="true" /> if the background image of the <see cref="T:System.Windows.Forms.ListView" /> should be tiled; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.BackgroundImageTiled%2A> property returns `false` if an image is not set.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="BeforeLabelEdit">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.LabelEditEventHandler BeforeLabelEdit;" FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0;windowsdesktop-6.0" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.LabelEditEventHandler BeforeLabelEdit" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.ListView.BeforeLabelEdit" />
<MemberSignature Language="VB.NET" Value="Public Custom Event BeforeLabelEdit As LabelEditEventHandler " />
<MemberSignature Language="F#" Value="member this.BeforeLabelEdit : System.Windows.Forms.LabelEditEventHandler " Usage="member this.BeforeLabelEdit : System.Windows.Forms.LabelEditEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:
 event System::Windows::Forms::LabelEditEventHandler ^ BeforeLabelEdit;" />
<MemberSignature Language="C#" Value="public event System.Windows.Forms.LabelEditEventHandler? BeforeLabelEdit;" FrameworkAlternate="windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0" />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.LabelEditEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the user starts editing the label of an item.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.BeforeLabelEdit> event occurs when the user starts modifying the text for an item. If the event handler cancels this event, the user cannot edit the text. You can use this event to prevent the user from editing specific items in the <xref:System.Windows.Forms.ListView> control. If the <xref:System.Windows.Forms.ListView.LabelEdit%2A> property of the <xref:System.Windows.Forms.ListView> control is set to `false`, the <xref:System.Windows.Forms.ListView.BeforeLabelEdit> event is not raised; all user attempts to edit item labels are automatically rejected.
For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
## Examples
The following code example demonstrates handling the <xref:System.Windows.Forms.ListView.BeforeLabelEdit> event and using the <xref:System.Windows.Forms.LabelEditEventArgs.Item%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.LabelEditEventArgs.CancelEdit%2A?displayProperty=nameWithType> properties. To run the example, paste the following code into a form that contains a <xref:System.Windows.Forms.ListView> control named `ListView1` and populated with at least three items. Ensure the event handler in the example is associated with its event.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ListView3/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LabelEditEventArgs/Overview/form1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListView3/VB/form1.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.ListView.OnBeforeLabelEdit(System.Windows.Forms.LabelEditEventArgs)" />
<altmember cref="E:System.Windows.Forms.ListView.AfterLabelEdit" />
<altmember cref="T:System.Windows.Forms.LabelEditEventHandler" />
<altmember cref="P:System.Windows.Forms.ListView.LabelEdit" />
</Docs>
</Member>
<Member MemberName="BeginUpdate">
<MemberSignature Language="C#" Value="public void BeginUpdate ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void BeginUpdate() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.BeginUpdate" />
<MemberSignature Language="VB.NET" Value="Public Sub BeginUpdate ()" />
<MemberSignature Language="F#" Value="member this.BeginUpdate : unit -> unit" Usage="listView.BeginUpdate " />
<MemberSignature Language="C++ CLI" Value="public:
 void BeginUpdate();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Prevents the control from drawing until the <see cref="M:System.Windows.Forms.ListView.EndUpdate" /> method is called.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The preferred way to add multiple items to a <xref:System.Windows.Forms.ListView> is to use the <xref:System.Windows.Forms.ListView.ListViewItemCollection.AddRange%2A> method of the <xref:System.Windows.Forms.ListView.ListViewItemCollection> (accessed through the <xref:System.Windows.Forms.ListView.Items%2A> property of the <xref:System.Windows.Forms.ListView>). This enables you to add an array of items to the list in a single operation. However, if you want to add items one at a time using the <xref:System.Windows.Forms.ListView.ListViewItemCollection.Add%2A> method of the <xref:System.Windows.Forms.ListView.ListViewItemCollection> class, you can use the <xref:System.Windows.Forms.ListView.BeginUpdate%2A> method to prevent the control from repainting the <xref:System.Windows.Forms.ListView> every time that an item is added. When you have completed the task of adding items to the control, call the <xref:System.Windows.Forms.ListView.EndUpdate%2A> method to enable the <xref:System.Windows.Forms.ListView> to repaint. This way of adding items can prevent flickered drawing of the <xref:System.Windows.Forms.ListView> when lots of items are being added to the control.
If <xref:System.Windows.Forms.ListView.BeginUpdate%2A> is called more than once, <xref:System.Windows.Forms.ListView.EndUpdate%2A> must be called an equivalent number of times. Until the last call to <xref:System.Windows.Forms.ListView.EndUpdate%2A> the <xref:System.Windows.Forms.ListView> will not repaint. Other than this, multiple calls to <xref:System.Windows.Forms.ListView.BeginUpdate%2A> have no effect.
## Examples
The following code example demonstrates initializing a <xref:System.Windows.Forms.ListView> control to contain check boxes. It also demonstrates how to use the <xref:System.Windows.Forms.ListView.BeginUpdate%2A> and <xref:System.Windows.Forms.ListView.EndUpdate%2A> methods. To run this example, paste the following code into a form that contains a <xref:System.Windows.Forms.ListView> named `ListView1`. Call the `InitializeListView` method from the form's constructor or `Load` method.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ListView2/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ItemCheckEventArgs/Overview/form1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListView2/VB/form1.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.ListView.EndUpdate" />
<altmember cref="M:System.Windows.Forms.ListView.ListViewItemCollection.AddRange(System.Windows.Forms.ListViewItem[])" />
<altmember cref="M:System.Windows.Forms.ListView.ListViewItemCollection.Add(System.String)" />
</Docs>
</Member>
<Member MemberName="BorderStyle">
<MemberSignature Language="C#" Value="public System.Windows.Forms.BorderStyle BorderStyle { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.BorderStyle BorderStyle" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.BorderStyle" />
<MemberSignature Language="VB.NET" Value="Public Property BorderStyle As BorderStyle" />
<MemberSignature Language="F#" Value="member this.BorderStyle : System.Windows.Forms.BorderStyle with get, set" Usage="System.Windows.Forms.ListView.BorderStyle" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Windows::Forms::BorderStyle BorderStyle { System::Windows::Forms::BorderStyle get(); void set(System::Windows::Forms::BorderStyle value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.ComponentModel.DefaultValue(System.Windows.Forms.BorderStyle.Fixed3D)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.DefaultValue(System.Windows.Forms.BorderStyle.Fixed3D)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.Runtime.InteropServices.DispId(-504)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.InteropServices.DispId(-504)>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.BorderStyle</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the border style of the control.</summary>
<value>One of the <see cref="T:System.Windows.Forms.BorderStyle" /> values. The default is <see cref="F:System.Windows.Forms.BorderStyle.Fixed3D" />.</value>
<remarks>