Hey guys,
This is my first time using Daniweb and I think I messed up! I need HELP--- I need a electronic addressbook. I need 8 text boxes:
1) name of contacts
2) company name
3) Address
4) city
5) state
6) phone
7) fax
8) email address
But the problem comes in when I try to write the program to read only partially. For example name of contact, instead of typing the whole name I only want to use partial--- Kim will pull up Kimmy, Kimlok, Kimm.

I want each textbox to read partially.

Please help
CONFUSED

Hey guys,
This is my first time using Daniweb and I think I messed up! I need HELP--- I need a electronic addressbook. I need 8 text boxes:
1) name of contacts
2) company name
3) Address
4) city
5) state
6) phone
7) fax
8) email address
But the problem comes in when I try to write the program to read only partially. For example name of contact, instead of typing the whole name I only want to use partial--- Kim will pull up Kimmy, Kimlok, Kimm.

I want each textbox to read partially.

Please help
CONFUSED

Sounds like a problem with class design to me.

public class addressBook
{
    string contactName
    string phoneNo
}

Then you could search the array of objects by either .contactName or .phoneNo etc.

>For example name of contact, instead of typing the whole name I only
>want to use partial--- Kim will pull up Kimmy, Kimlok, Kimm.
I can think of a few ways to do this. The first is autocomplete where you keep track of the characters being entered, search for the string up to the most recent character typed and complete the entry with the first match of that search (the TextBox control supports this feature natively). Next, you can do the same thing except filter the contents of a combo box instead of just using a straight text box. A more user friendly design would probably use a tooltip and/or context menu with suggested matches, but that would take a little more work.

You might also need to use the get key pressed thingy? I must admit I missed that part:

want to use partial--- Kim will pull up Kimmy, Kimlok, Kimm.

Hey guys,
This is my first time using Daniweb and I think I messed up! I need HELP--- I need a electronic addressbook. I need 8 text boxes:
1) name of contacts
2) company name
3) Address
4) city
5) state
6) phone
7) fax
8) email address
But the problem comes in when I try to write the program to read only partially. For example name of contact, instead of typing the whole name I only want to use partial--- Kim will pull up Kimmy, Kimlok, Kimm.

I want each textbox to read partially.

Please help
CONFUSED

you need an ontextchange event that will popup a list of possible names based on the letter typed.

if your information is stored in a database you could do this very easily.

like when they start to type the letter k an SQL statement would run that would return

SELECT FIRSTNAME FROM [SOMEDATABASE] WHERE FIRSTNAME LIKE 'k%';

but thats the best i can come up with.

or prebuild an array with all of the names sorted by letter and then use the same logic.. :!:

you have to trap ontext change event by double clickiking on textbox in design form, and run sql like(select (columnname) frm(database)where (columnname) like =' "'"+textboxname.text+"'"%'

This article has been dead for over six months. Start a new discussion instead.