Windows Develop Bookmark and Share   
 index > Windows Forms General > Select All in FileView
 

Select All in FileView

I'm having trouble being able to use CTRL + A to select all items of a fileview.

I'm able to do multiple selections and eventually select all by using Shift and the mouse but would like Ctrl + A to be available.

How can that be done?

Thanks

wayliff  Tuesday, May 15, 2007 8:30 PM
private void listView1_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.A)
{
listView1.SelectedItems.Clear();
foreach (ListViewItem Item in listView1.Items)
{
Item.Selected = true;
}
}
}
decyclone  Wednesday, May 16, 2007 1:15 PM
What control is a "fileview"?
nobugz  Tuesday, May 15, 2007 10:46 PM

oh my what an idiot i am...

I used the name i gave to it in the property...

I am referring to the ListView.

wayliff  Wednesday, May 16, 2007 12:52 PM
private void listView1_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.A)
{
listView1.SelectedItems.Clear();
foreach (ListViewItem Item in listView1.Items)
{
Item.Selected = true;
}
}
}
decyclone  Wednesday, May 16, 2007 1:15 PM

PrivateSublistView1_KeyDown(ByValsenderAsObject,ByValeAsKeyEventArgs)
If(e.ControlAndAlso(e.KeyCode=Keys.A))Then
listView1.SelectedItems.Clear
ForEachItemAsListViewItemInlistView1.Items
Item.Selected
=true
Next
EndIf
EndSub

THANKS!!! Easy enough.


wayliff  Wednesday, May 16, 2007 1:50 PM

You can use google to search for other answers

Custom Search

More Threads

• TextBox's efficiency
• DataGridView background
• Icon in System Tray Does does not go away
• File processing
• Default Active Directory user window
• Install package with .NET Framework
• Webbrowser Control and NTLM Authentication
• DataGridView - virtual and bound?
• How to bring 2-window app back to front after Ctrl-Tab or clicking app icon at Taskbar?
• Create an appbar in visualbasic.net