index jump in list box
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: index jump in list box

  1. #1
    Join Date
    Feb 2009
    Posts
    112

    index jump in list box

    Hi, I have a program that will gather all the names of files and put them into a list box and when the user presses enter on a file it will run that file. however this program is only going to be used with a keyboard. the problem is that if the directory the files are in had a couple hundred files it would take a long time to scroll all the way to the bottom. What I would like to do is have it so that if the user presses the right arrow it wil jump 10 files or if the user presses the left arrow it will jump back 10 files. I would assume I would have to change the selected index and would have to have error checking to not go above the max number of files or below zero. It's just that I do not know how to get it to make it recognize the fact that the user pressed the left arrow or right arrow.

    If you could provide any help, it would be greatly appreciated.


    Thanks,
    Randell.

    **Edit** Also I'm useing visual basic 2008 express with .NET framework 3.5

  2. #2
    Join Date
    Jun 2008
    Posts
    2,477

    Re: index jump in list box

    I'm guessing here as I do not have time to test this right now, but what happens when you pres the PageUp and PageDown buttons? Those are pretty standard ways of taking larger jumps through lists and TrackBars. If that is not built in, you could just capture OnKeyDown and change the selected item yourself. I don't think that that will auto-scroll though...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center