473,378 Members | 1,209 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,378 software developers and data experts.

how to add items in a list box..........

2
hi,
i m new to this VB 6.0, so any one can help me regarding this issue.
i need to display the text entered ina text box ina list by clicking the a command button.syntax for this..........
Aug 14 '07 #1
5 4267
Killer42
8,435 Expert 8TB
hi,
i m new to this VB 6.0, so any one can help me regarding this issue.
i need to display the text entered ina text box ina list by clicking the a command button.syntax for this..........
I guess what you need to do is pick apart the text into separate lines by looking for the CR+LF delimiter, then use AddItem to add each line to the listbox.

To find the end-of-line delimiters, you could either loop through the text character by character, or use Instr() function to scan for each one.

Or is your textbox only a single line? If so, that's really simple. Just use the AddItem method on the ListBox to add the .Text property from the TextBox.
Aug 14 '07 #2
hill
2
I guess what you need to do is pick apart the text into separate lines by looking for the CR+LF delimiter, then use AddItem to add each line to the listbox.

To find the end-of-line delimiters, you could either loop through the text character by character, or use Instr() function to scan for each one.

Or is your textbox only a single line? If so, that's really simple. Just use the AddItem method on the ListBox to add the .Text property from the TextBox.
thanx 4 dat, i have a doubt regarding this delimetr, so can u plz tell me the simple way to add a text ina text box to a list box.
i have some idea regarding list box add item but can u plz give me the syntax 4 dat.................
Aug 14 '07 #3
hariharanmca
1,977 1GB
thanx 4 dat, i have a doubt regarding this delimetr, so can u plz tell me the simple way to add a text ina text box to a list box.
i have some idea regarding list box add item but can u plz give me the syntax 4 dat.................


Can you explain in detail?

to add text in listbox

Expand|Select|Wrap|Line Numbers
  1. lstBoxName.Add(AddItemHere)
Aug 14 '07 #4
Killer42
8,435 Expert 8TB
Expand|Select|Wrap|Line Numbers
  1. lstBoxName.Add(AddItemHere)
According to my VB6, it's AddItem.
Aug 14 '07 #5
hariharanmca
1,977 1GB
According to my VB6, it's AddItem.
yes you are correct,

Expand|Select|Wrap|Line Numbers
  1. lstControl.Additem(strItemHere,iniIndex);
Aug 14 '07 #6

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

Similar topics

8
by: Charlotte Henkle | last post by:
Hello; I'm pondering how to count the number of times an item appears in total in a nested list. For example: myList=,,] I'd like to know that a appeared three times, and b appeared twice,...
3
by: Jeremy Owens-Boggs | last post by:
We are trying to implement a dual list box selection where you have two list boxes, You highlight items in the right side list box, click a button and this moves those items over to the left hand...
5
by: Kay | last post by:
Hello, I have two list boxes on my form, one initially displays with items and the other displays blank, by clicking a button, it is possible to move items from one box to another and vice a...
10
by: Adam Clauss | last post by:
I have a page containing a list box. This list may contain duplicate items - in which the ORDER is important. ex: a b b a is significant as compared to: b
4
by: John Wildes | last post by:
Hello I have a small program that I've created to generate accounting statements out of our policy managment system. The first part of the process is selecting the customer to create the...
0
by: Brian Henry | last post by:
Since no one else knew how to do this I sat here all morning experimenting with this and this is what I came up with... Its an example of how to get a list of items back from a virtual mode list...
10
by: pamelafluente | last post by:
Hi I have a sorted list with several thousands items. In my case, but this is not important, objects are stored only in Keys, Values are all Nothing. Several of the stored objects (might be a...
8
by: JuliaRBarton | last post by:
I have looked everywhere I can for a solution to this problem but nothing so far has worked. I have two list boxes in my form. The first one (selAvailable) is populated from an access database....
13
by: Joel Koltner | last post by:
Is there an easy way to get a list comprehension to produce a flat list of, say, for each input argument? E.g., I'd like to do something like: for x in range(4) ] ....and receive
13
by: PetterL | last post by:
I writing a program where I read menu items from a file. But I have problem when I click an menu item i want it to mark that one as checked but I cant access the menu object of that item to see...
1
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.