Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a history list

Status
Not open for further replies.

Wantabie

Programmer
Apr 29, 2004
72
US
I have a small applet that is used to ping and telnet to various host routers. I would like to create a history list of what is typed into a text box. So that, when the same host comes back up. The user can select it from the list, instead of having to type it into the textbox. But when a host comes up and is not in the list. it can be added.

Is this possible?

Any suggestions are welcome..

Wantabie
 
Do a search in this forum for AutoComplete, I believe you'll find lot's of threads that might be helpful.

Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Yes that would work, if i had a list of the routers, already in a list box. But no.

What i am looking for, is for any examples that will show me how i can take a blank list and textbox and when a user types in a router name, it will populate the listbox, as well.
Then, if the name exists in the list, (meaning that it has already been entered into the textbox once), that person can have the option to select it from the list.

I.e. A search engine text field and history list

 
Sort of like an AutoComplete combobox, that is populated from a db table and if what is typed is not in the table then on saving add it to the table, then next time when the typing begins it is now in there and autocompletes for you. If this is in the ballpark then with little modification this thread should work. thread222-757158

Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Can it be used, without a db table. but with an array. The applet is being used with the WRQ Reflection terminal emulation program... That has a Visual Basic Editor built into the program.
 
However, i will give the AutoComplete a try and see if it can be done with arrays...

Thanks for the suggestion...
 
With an array, there will be no persistence. So whenever you shutdown the app, your list will go away.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
You need to store the values somewhere, a text file, the registry, db, etc.

Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Exactly, with an array it will not be saved, so when the app is closed the array is emptied. that is how i would like the list to work. When the application is opened and remains open the list can grow.

Much like the history of a command prompt window. When open, it stores the command entries somewhere and clears it when closed.

Now, with a combobox, can i enter in an entry and it grow, if i declare it a an array()?
 
Thanks for your help. I will give this a try and let you know...
 
Ok, you're going to have to help me here. I am not sure how to imeplement the code into my code.

I have a text box (txtHost) and i have copied the 'ArrayToListBox' code into a module.

My dilemma is, how i am going to take the string from the text box and put it into the list box?

Any suggestions...
 
I would replace the txtHost with a combo box. Then maybe in the validate event of that combo add the text value to a global array, but only if it is not already in the array or meets some other validation test. Then in the gotfocus event of the combo call the ArrayToListBox function which populates the combo. Then to take it a step further you could implement a modified version of the autocomplete class.

Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Ok, I am having a hard time figuring this out. You guys have given me good suggestions. I will take them and see if i can get somehting to work...

Thanks, Wantabie...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top