Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 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 January 29th, 2004, 08:54 AM
Registered User
 
Join Date: Jan 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default key-sensitive ListBox control

I made a Windows application using C#. WinApp consist a ListBox control with a large catalogue items. When you type some letter a ListBox control select a first item in catalogue with chosen first letter in some item name. Because a catalogue have many items with the same first letter in item name I want that any second letter you type treat as a next letter in a name of item, not as a first letter of some other catalogue item. Can somebody give me idea how to programming a ListBox control to do that? I think that I was formulating a question well. Thanks.

 
Old January 29th, 2004, 09:04 AM
Registered User
 
Join Date: Aug 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've had to go through this before too. I'm not sure about the C# calls and event names, but in VB it was the keypress event that did the trick. Just get the time of the keypress at the beginning of the command. Compare this to a form level variable you saved the last time a key was pressed. If the strokes occur fast enough, concatenate them to another form level variable, otherwise make the reinitialize it to the key that was pressed. Use this string to find the next one with a greater list index than the one currently selected. Hope this helps.

Wes






Similar Threads
Thread Thread Starter Forum Replies Last Post
WinForms ListBox with user control items vik C# 3 November 27th, 2008 10:44 AM
user control Key Down buvana Visual Studio 2005 1 January 7th, 2007 06:15 PM
Deleting files using a listbox control Indo77 ASP.NET 1.0 and 1.1 Basics 1 April 20th, 2006 10:43 AM
User Control: Tab key does not work alhad VB.NET 2002/2003 Basics 0 November 3rd, 2005 03:20 AM
Max of listbox control items Snowingnow Beginning VB 6 1 November 22nd, 2004 02:05 PM





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