473,320 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

ListBox issue

15
Hello
I have a listbox with 30 items/values and i am binding these values from database. Here is my question when 'A' is pressed automatically how can i transfer the control to the word that starts with 'A' and when 'B' is pressed control should go to the word that starts with 'B' and so on......

Please advise
Feb 26 '09 #1
7 1368
Hiiiiiii
You can solve this problem using ajax toolkit and web service.



Please visit this link.



http://www.asp.net/AJAX/AjaxControlT...oComplete.aspx
Feb 26 '09 #2
tlhintoq
3,525 Expert 2GB
Can't you just use the KeyPress event to a method that loops through the ListBox.Items and checks if it it starts with the letter pressed?

That's how I would do it in a Windows Forms application.
Feb 26 '09 #3
@tlhintoq
i dont know why do you need to list box u can do this work from textbox
bec. u cant input anything in list box, this is work like combo box.
Feb 27 '09 #4
tlhintoq
3,525 Expert 2GB
@bhupinder
The O.P. (Original Poster) never said anything about needing to input text. The need was to select an item from a list of choices. Think of it like selecting a country from a list: You don't type in "United States". You hit 'U' and the first country that starts with 'U' is brough to the selection.
Feb 28 '09 #5
@tlhintoq
Ok, i agree with u. but one thing tell me, you need to some button or input any control in which you can type 'U' that word you select, If you want this way , i think , this is more compatible.
Feb 28 '09 #6
hiiiiiiiiiiiiiii

Follow this link
http://www.codeproject.com/KB/scripting/autosearch.aspx
Feb 28 '09 #7
tlhintoq
3,525 Expert 2GB
@bhupinder
Yes, and no. You have to have a control that receives the action of pressing a key. That is not the same as having a control that *displays* the key you press. Using a textbox as the tool to have a listbox make a selection just confuses the user. The ListBox itself can react to a KeyPress if it is the control that has focus.

Or one can get fairly exotic and start intercepting the Windows Messages for keys being pressed and decide where to route those messages. This is how I handle "behavior shortcut keys" is some applications.
Feb 28 '09 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: JoeHenrich | last post by:
I am using VS.NET 2003 and am having an interesting issue with a Listbox control. Essentially, I have a form with a listbox on it. In the listbox doubleclick event I would like to do some...
8
by: Oddball | last post by:
Ok - I have a ListBox control and I'm ready to write my own DrawItem event handler. What I want to draw as the item is another control. I have created a user control that I would like to list in...
10
by: yop | last post by:
All When I try to get the text from my listbox I am get an error which is listed below. Any ideas? Thanks Object reference not set to an instance of an object.
3
by: Dean Slindee | last post by:
In a checked listbox, I am allowing drag/drop of the items within (resequencing). Problem is, when dropping a checked item, the checked state always reverts to unchecked (unwanted). Anyone know...
2
by: Rlrcstr | last post by:
I'm rolling my own with a listbox. The items in the list box are of varying sizes and I'm hit checking when the litbox is checked to see what portion of an item the user has clicked on. Mostly...
6
by: Mark | last post by:
Hello. I have a listbox whose rowsource is set to a saved query (call it "qry_customer_list.") When I add customers to my database, I call the listbox Requery method so that the listbox will...
2
by: Steve Potter | last post by:
I am trying to find some method of attaching a Listbox object to a list object so as the contents of the list are changed the contents of the Listbox will be updated to match. I have found a few...
18
by: Zytan | last post by:
I want the same function to be run whether you press Enter or double click the listbox. It seems really verbose to write both handlers to both events everytime, even if they both call the same...
15
by: Doogie | last post by:
I have a .net app that a user currently enters a number in a text box, hits a button and a data call is executed. She wants the ability to enter in multiple numbers (up to 100). So to make...
5
by: MelindaM | last post by:
Hi guys, I created a form for searching through a parts library that I have stored in a MySQL database. I'm not new to web programming but this is my first time using PHP and Ajax. I have four...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.