Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 22nd, 2007, 12:25 AM
Authorized User
 
Join Date: Aug 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to gmbalaa
Default Select the all itmes in listbox by pressing Ctrl+

Hi to all,

I need a code for selecting the all values appear in the listbox by pressing the Ctrl+A.

I know the code for get the single key event in the listbox's keydown sub, but how to get the both Ctrl+A keycode value inside the keydown sub.

any one know about this pls share with me.....

thanks in advance.
 
Old August 22nd, 2007, 02:17 AM
Authorized User
 
Join Date: Aug 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to gmbalaa
Default

 Resolve this problem...

I want to share here.

Private Sub ListBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles ListBox1.KeyDown

        If e.KeyCode = Keys.A And Control.ModifierKeys = Keys.Control Then
            Dim i As Integer
            For i = 0 To Me.ListBox1.Items.Count - 1
                Me.ListBox1.SetSelected(i, True)
            Next
        End If
End Sub


This is working well...





Similar Threads
Thread Thread Starter Forum Replies Last Post
select value in listbox please help urgent akssmv C# 2005 1 July 9th, 2007 06:07 AM
Select an particular item when a listbox opens? alastair Access 2 December 29th, 2005 06:04 PM
select statement with listbox item(where qnsID =" Astro VB How-To 2 August 31st, 2005 02:12 AM
Ctrl Click with SELECT MULTIPLE rweide HTML Code Clinic 4 October 5th, 2004 12:14 PM
Pressing Enter should fire an event r_ganesh76 ASP.NET 1.0 and 1.1 Professional 4 September 28th, 2004 12:02 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.