473,778 Members | 1,781 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Combination of textbox and listbox in VB 6

Mohan Krishna
115 New Member
Hi Everyone,

I'm working with a project, in which i used a listbox and textbox as a combination. Hoping anyone would help me, i explianed my problem:-

There is a list of companies (sorted or not) in a listbox. While typing in textbox, as per each letter is being typed, the company names in the list MUST BE SELECTED.
For eg:
In Textbox In Listbox
M List starting with M should be selected.
Mi List starting with Mi should be selected.
Mic List starting with Mic should be selected.
Micr List starting with Micr should be selected.
and so on. If no list with starting letter is found, the very first item in the list should be shown.

I hope i explained my problem clearly. If there is a solution for this already. I'm sorry to ask it again. But, as I could not find after severl searches, I post this question.

TIA
Mar 8 '08 #1
4 2879
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

Write this in Change Event of TextBox:
Make the property of ListBox :
Sorted = True


Expand|Select|Wrap|Line Numbers
  1. List1.Text = Text1.Text
  2. If List1.SelCount = 0 Then List1.Selected(0) =True
  3.  
REgards
Veena
Mar 8 '08 #2
Mohan Krishna
115 New Member
Hi,

Write this in Change Event of TextBox:
Make the property of ListBox :
Sorted = True

Veena
Hi Veena,

Thank You for a quick and helpful reply.

Can't we extend the list for all the items starting with the letter(s) while we type in?

Thank you once again!

WIth regards,
Mohan
Mar 9 '08 #3
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

Instead of allowing to Type in textBox, and show the list, Make ListBox's Property Sorted = True and Set Focus to ListBox.. When user types first few letters, Matching List Item will be highlighted..

Regards
Veena
Mar 10 '08 #4
Mohan Krishna
115 New Member
Hi,

Instead of allowing to Type in textBox, and show the list, Make ListBox's Property Sorted = True and Set Focus to ListBox.. When user types first few letters, Matching List Item will be highlighted..

Regards
Veena

Thank u very much!

Can't we try like this in VB 6?



TIA
Mar 11 '08 #5

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

Similar topics

3
3180
by: AsuWoo | last post by:
hi, I want to implement a function that prints all possible combinations of a characters in a string,eg. input "123"into a textbox, add "1","2","3","12","13","23","123",to a listbox,Or "ab" into a textbox,add "a","b","ab"in a listbox,could anyone help me out ?
1
4139
by: AsuWoo | last post by:
hi, I want to implement a function that prints all possible combinations of a characters in a string,eg. input "123"into a textbox, add "1","2","3","12","13","23","123",to a listbox,Or "ab" into a textbox,add "a","b","ab"in a listbox, but two combinations that differ only in ordering of their characters are the same combination. in other words "12" is the same as "21", i want to know hao to implement by c#, thanx
0
1815
by: John R. | last post by:
I want to add a textbox next to each item in a Listbox on a Windows Form. The items need to be scrollable so I thought that maybe this is possible with an Owner Draw listbox. Searching the web and newsgroups I don't find an example anywhere how I could add a textbox or other control to an Owner Draw listbox. Can someone show me how I'd add a textbox to each listbox item using an Owner Draw listbox?
28
4379
by: kfrost | last post by:
I know this is probably simple but I have a C# form and the class for the form is called sbaSynch. I have a textbox name txtServerName. I'm creating a class to manipulate XML functions so I added a class to project and it's named XmlApi(). In the XmlAPI() class I have simple code as following XmlAPI() { string str = "Some Text";
4
1473
by: Kav | last post by:
As the title states, on my development PC there is a textbox which allways displays as a textbox. However on the clients PC it is showing previous entries he has made to the TextBox as a ListBox. Now this sounds to me like an Internet Explorer setting needs changing but then I thought how do you go about making sure a TextBox allways displays as a Textbox regardless of the users IE settings? For example you wouldn't want a login...
9
3249
by: zdrakec | last post by:
Hello all: Clearly, I'm not getting it! Here is the scenario: On a web page, I have two list boxen and a text box. The first listbox is populated at page load time (if it is not a postback). This listbox has AutoPostback = True. When the user selects an item from this list, the second listbox is populated with more items relevant to this selection. I am using an SQLDataSource web control for this. These items are headers. I want, when...
7
2870
by: billa856 | last post by:
Hi, My project is in MS Access 2002. In that I have two forms which I am using for Shipping Entry. Now First Form(ShippingAlerts) Is fillup by persons working in customer services.and the Second Form(ShippingEntry) is fillup by workers operating Hi-Low machines to put Boxes in Trucks. Now In First Form(ShippingAlerts)I have some fields like AutoNo,BillToAddress,ShipToAddress. and some other like CustomerCode,ItemNo,PONo,LONo,PalletNo...
2
2743
by: E11esar | last post by:
Hi there. I am looking to use a dataset return from a webservice that is currently populating a listbox, to also populate a value in a textbox that is loaded once an item is selected from the listbox. My code for the above part that populates the listbox is as follows and this works fine. listBox.DataSource = myWebService.MethodName(param1, param2); listBox.DataValueField = "RETURN_DETAILS_ONE"; listBox.DataBind();
9
10791
by: weirdguy | last post by:
Hello, Just for anyone information, there is a similar title "Search in Listbox" but it is via Combo Box. In case, anyone need it, I put a link to here. Please let me know if I break any rules by posting a link so then, I will remove it. Okay, here is my question. If you ever refer to the link, I am almost doing the same thing. Just that, I am doing a textbox and a combo box to search the listed data in the listbox. The listbox...
0
10292
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8954
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6722
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5368
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5497
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4031
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3627
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2860
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.