Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Modify The Text In A Listbox Item


I have a list box in a Excel Form. at some point i want to modify the text of the selected item in the list box. When i use lstItems.Text="xyz", its not accepting.
I dont want to delete and add the item as there is no "sort" option for the listbox. If anybody knows please let me .
Thanks
Vijay S




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Solved-howto Send First Item Of Listbox Totextbox, Then Delete First Item Of Listbox?
Lol another question, how do you do this

how to send first item of listbox to textbox, then delete first item of listbox?

Thanks

Change ListBox Item Text?+ Change Item Color Or Status?
hi
I'm new to VB. I want to change the text of a ListBox item.
I used AddItem to add items.
Then I tried to change a selected item using lst.Text = "somethingNew", but it doesn't work...
Pl. help

And need to know.. how to change the color of an item or status(disable) of an item???

Thanks

How To Get The Text Of Item In A Listbox?
I am using a test tool that uses VBA as its back end. When I record the action the tool itself only recongnizes the NAME of the item selected in the list...in most cases this is best.

However, I really need it to select by text, but this does not seem to work. So I want to write a little VBA that will extract the text of the displayed selection in the listbox after my test tool plays back the selection.

Example:
the text displayed is "English"
the name of this item is "en-US"

I want:
textDisplayed = text.listbox, which will mean textDisplayed = "English"

I was wondering what the syntax for this is? rather new to VB.

Thanks in advance

Listbox Item Text
Hello, i want to display the text in a listbox item.

list1.text will display for the selected text
however,
i want to obtain the text for a particular item in the list

ie: get list1 item 3's text

Listbox - Changing The Text Of Item
Hi I have included an example in the zip file to show what i'm trying to do:

I have three checkoption boxes - Apple, Banana and Orange and
a listbox (list1)

When the checkbox is ticked the item appears in the list1 listbox - All this works fine but now I need to do one more thing

If the items Apple, banana and orange are in the listbox I need to be able to change the item name into its colour for example on double click turn:

The text 'apple' into the text 'Green' or the text 'banana' into 'Yellow' or 'orange' into the text 'same as fruit' - but only the item selected and not all of them in one go

Because I want to be able to keep some items as the fruit name and change others to the colour of the fruit

Is this even possible and if so any advise on how to do it?

Listbox Text Item Forecolor
I have a List box with a number of entries listed from a database.
I need a way of changing the font style to italic for an individual entry on a certain condition:

For example:

If the text of say listindex number 2 = "Products" then i need just that line to be italic

is it possible using ordinary listboxes?

thanx

clax

Removing An Item From A Listbox Specifing The Text
hi to all!!!

first of all... good forum! i'm a newbie , i have just registered

(... i'm italian... )

my question is:
can I remove an item from a list box specifing the text?

example: I write the caption of a listbox item and by clicking a button i want to remove it.

(.. I hope you have understood )

simply: i want to remove an item specifing the caption and not the index of the item


greetz
simons

Listbox: Change Text Of Selected Item
hi all,

just wondering if anyone knows a way of changing the text of the selcected item in a list box?

for example: if i have a listbox with the following list items:

one
two
three
four

and "two" is selected, and i need to change its text to "this one".

i would like to avoid regenerating the list by clearing it and adding all the items again if possible.


thanks for your time and consideration,

mojoinst

When Moving Item Down In The Listbox The Text Disappears
Okay dont know why but the text is dissapearing when an item is moved down the list box.

Image1 displays before the move down
Image2 displays after the move down
Code is also attached. I am very confused I have been through this code througherly and I am sure there is not an error in the code.




Code:
' check: only proceed if there is a selected item
' check: last item can't be moved down
' save items text and items indexvalue
' remove item
' place item back on new position
' if you keep that item selected
' you can keep moving it by pressing cmdDown
' for arLoopCount adds the new playlist entrys from
' lstPlayList.
' list1 refreshes
' lstPlayList refreshes
Dim tempStr As String
Dim iIndex As Integer
Dim arLoopCount As Integer
List1.Clear ' Debugging orriented object to display the contents of arFilePlayList Array
If lstPlayList.SelCount = 1 Then
If lstPlayList.ListCount - 1 = lstPlayList.ListIndex Then
Exit Sub
Else
tempStr = lstPlayList.List(List1.ListIndex)
iIndex = lstPlayList.ListIndex
lstPlayList.RemoveItem lstPlayList.ListIndex
lstPlayList.AddItem tempStr, iIndex + 1
lstPlayList.Selected(iIndex + 1) = True
End If
End If
For arLoopCount = 0 To lstPlayList.ListCount
arFilePlayList(arLoopCount) = lstPlayList.List(arLoopCount)
List1.AddItem arFilePlayList(arLoopCount)
Next arLoopCount
List1.Refresh
lstPlayList.Refresh

How Can I Set The Text To Bold In The Selected Item Of A Listbox.
how can I set the text to bold in the selected item of a listbox. I need it to be like that until another file listitem is double clicked.

Listbox Remove Item By Matching Text With A Textbox
Is it possible to remove a item from a listbox but no using index removing a item with the same text as the text in a textbox instead.

Eg

I had a listbox with this in

Hello1
Hello2
Hello3
Hello4

and i had a textbox with the text

Hello4

in it.

Is it possible to remove a item from the listbox by matching the text in the textbox with the same text in a the listbox and then removing that item.


vb Code:
list1.removeitem (text1.text)


I no that wont work, just i don't really know how to explain it.

Thanks

How To Modify An Item In ListView?
Hey guys,

Can anyone teach me how to modify an item in a listview. For example I have two columns : Item Name, Quantity

How can I select one item and modify the quantity which later can be updated to database?

Please enlighten me...thanks
Jeremy

Quick Question: Listbox And Substituting Text For List Item
Ok, here's the problem: I've got my listbox right? I have a whole bunch of list items in the list box that have a very very long caption. Now what I want to happen is when a user clicks one of those captions, it is to have some DIFFERENT text to be stored into a variable. Like I click the list item, a separate piece of text is then stored into a string variable. Then later on, in a different form, I want to be able to use that variable to display the text instead of the text in the list box. I have some code set up but I am not exactly sure how to manipulate it.


VB Code:
Private Sub List1_Click(Index As Integer)Dim NPC1 As StringNPC1 = List1(0).TextDim NPC2 As StringNPC2 = List1(1).TextDim NPC3 As StringNPC3 = List1(2).TextDim NPC4 As StringNPC4 = List1(3).TextDim NPC5 As StringNPC5 = List1(4).TextDim NPC6 As StringNPC6 = List1(5).TextDim NPC7 As StringNPC7 = List1(6).TextDim NPC8 As StringNPC8 = List1(7).Text End Sub


Do I need to like have a line after that, that states:


VB Code:
Private Sub List1(6).Text_Click()NPC1 = ["textblahblah"]


Thanks!

(? Help) Change Listbox Selected Text Without .additem Or .remove Item
Hi, I browsed through posts and didnt see this question elsewhere so I hope I didnt miss it if it was answered already. If so im sorry.

I was wondering if there is anyway to change the selected text entry for a list box without adding or removing an item.

Example: If there were these options in a list box:

A
B
C

and "B" had been selected by the user is there anyway to change "B" to "D" without using the .additem or the .remove command? If you need me to restate or clarify what im asking please let me know and Ill repost as soon as I see it. Thanks for any help I get in advance.


- Sidenote: I would use a loop and simply add them into another list box and back into that one in a different in the correct order but theres some sticky and touchy coding done on the list box's _click statement that really wouldnt make such a loop possible....if this sidenote didnt make sense sorry its 5 am .

How We Can Modify Content Of An Item From A Collection Of UDT.?
How we can modify content of an Item from a collection of UDT.
Pls read through the code.


Code:
Private Type POINTAPI
X as Long
Y as Long
End TYpe

Private Sub Command1_Click()
Dim col As New Collection
Dim p As POINTAPI
col.Add p
col.item(1).x = 20
Debug.Printcol.item(1).x
'Returns only Zero, It should return 20.
' Why It not updating the content in the collection ?
'What's the solution to do this ?

End Sub

How To Search Listbox For Item If Item Not Found Add Item?
Hi, lol man I cant find nothing today when I search the forum.

This my latest problem, How do I search a listbox for an item lets say "Game Over" And if the item is found the program does nothing, but if the item is not found it will add "Game Over"

Thanks Again

Removing An Item From A ListBox By Clicking The Item
Hi, How do you remove an item from a ListBox by simply clicking the item u want to be removed?

This is the code i tried but it doesnt work:

Private Sub list1_Click()
Dim n As Long
Dim ncount As Long

ncount = List1.ListCount - 0
For n = 0 To ncount
List1.RemoveItem (n)
Next
End Sub

Any ideas?


-Flaw

Modify And Insert Line In Listbox
I don't know if this is possible but I'm trying to modify all existing entries in a Listbox and add them after each entry.

So if I have these entries:

got2goshop.com
gotoo.com
gotosearchmsmn.com

It would modify and add after each entry and the results would be this:

got2goshop.com
http://got2goshop.com
gotoo.com
http://gotoo.com
gotosearchmsmn.com
http://gotosearchmsmn.com

If anyone can help, thanks

Populate A Listbox Based On A Selected Item In Another Listbox
Ok...I am stumped.

I have a single form that has 3 list boxes. I have 4 public strings containing various values. Based on the selection from lstBox1, I need to populate the ListBox2 and ListBox3 list from values in the public strings. Clear as mud?? That is what I thought!

Example string variable

strLuxury = """Hand Wash"" ""Hand Wax"" ""Check Engine Fluids"" ""Detail Engine Compartment"" ""Detail Under Carriage"" ""Fragrance"" ""Shampoo Carpets"" ""Shampoo Upholstery"" ""Scotchgard"""

ListBox1 contains the following:

Standard
Deluxe
Executive
Luxury

ListBox2 is empty, but is contained in a frame indicating Exterior Options
ListBox3 is empty, but is contained in a frame indicating Interior Options

If Luxury is selected in ListBox1, then ListBox2 should contain
Hand Wash
Hand Wax
Check Engine Fluids
Detail Engine Compartment
Detain Under Carriage

And ListBox3 should contain
Fragrance
Shampoo Carpets
Shampoo Upholstery
Scotchgard

If Fragrance is present in ListBox3, a seperate dropdown box should appear allowing selection of the appropriate scent.

Yes, this is a homework assingment.

Thank you in advance for your help!
Mark

Transfering Item From One Listbox To Anotehr Listbox On Click
Hi all i got 2 listbox . I want to be able to click on my first listbox items and once i click on them it transfers to the second listbox. Could any one tell me how that can be done.Thanks

Listbox: How To Know Last Added Item's Index, When The Listbox Is Sorted?
When sorted property of a listbox is set to True, each new item added won't be at the end of the list, it will be automatically placed in the correct index, according to text order, is there a way to know which is the index of that item (last item added)? Looping to find it would be horrendous, I just need the index to mark that item selected.

How To Add A Listbox Item To A Listbox On Another Form Within The Project.
What is the best method to take an item selected in a listbox and add it to another listbox on a different form within the same app?

.: Please Help: Copy Selected Item(s) From A ListBox To The Other ListBox..
Hi everyone!

I'm having problem with copying file to another Listbox, please help..
So, in this case, I have two ListBoxes where the 1st ListBox holds several items..
I need to copy the selected item to the other listbox 'without' a repetition, I mean.. the same item won't copied anymore..
When the user tries to copy the item which have already been in the ListBox2, then a messagebox will pop up to warn the user of the existing item.... So, how should I do that??


Thanks a lot

Modify Text Of Crystal Report's Text Box
hello
first i will explain what i want to do, i want modify the text of a crystal report's text box, using "nameoftextbox.settext", but when i use it, in the report the text doesn't change but if i put msgbox nameoftextbox.text after the sentence with settext return me the text changed, but in the report i can't see it.
Please Help Me
this is the code, i am using crystal report 7 and visual basic 6

Report.RecordSelectionFormula = "{dte_cmd_estudio.dni}='" & rc_estudio("dni") & "' and {dte_cmd_estudio.tipo_estudio}=" & rc_estudio("tipo_estudio") & " and {dte_cmd_estudio.cod_estudio}=" & rc_estudio("cod_estudio")
Screen.MousePointer = vbHourglass
crEstudio_ano.Text27.SetText "hola"
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault

Pd sorry for the english i'm form Argentina

Modify Text
I need to import information from a text file. Its been years since Ive worked with modifying text. Please help???

the information from the text file will come in as a string in this format=

'164','W1230R', 6

And I need to drop all but the 164

misteff25

Modify A Text File
I have a text file with this format:

Joe
Dave
William
Susie

Using vb how can I click on a button and it will modify the text file to put a " at the begiing and end of each line:

Ie:

"Joe"
"Dave"
"William"
"Susie"

Modify A Text File
Anyone know how to modify a text file?

I have a bunch of settings with parameters and values inside an .ini file.

I need to modify the values base on the user's input.

I am using VB6.

Thanks.

How To Modify A Text File In Vb?
In vb, we can easily add something to a text file but I couldn't find a way to modify a part of text file. How? Thanks for your inputs.

Moving Listbox Item To Another Listbox
hi does anyone know of an easy way to move an item in a listbox to another listbox, lets say a source and target listbox and vice versa. thanks

Adding An Item From One Listbox To Another Listbox
I have several forms, one with a listbox that displays the selected records of a field from a database. I select(click) one of those records and want to have another particular field from that record display in another listbox on another form. So far it works with this code, but pulls all the records from the first listbox.
To be more specific, the database has populations and zip codes, etc. The field for population is called pop2001 and the zip codes is Zip. The listbox with the selected records displays zipcodes and I want to select one of those zipcodes and have it's population display in the other forms listbox, but it displays all of them. Can anybody help?


Code:
Private Sub Form_Load()

PopRecSet.MoveFirst
Do Until PopRecSet.EOF
frmpopfinal.lstpopfinal.AddItem PopRecSet![pop2001]
PopRecSet.MoveNext
Loop


End Sub

Listbox Name Showing Up As First Item In Listbox?
For some reason the listbox I've just added to my form shows the name of the listbox in itself at design time. At run-time, the name of the listbox shows up as the first item in the list.

I've tried looking for a CAPTION or TEXT property but neither seem to be present. Any ideas as to how to fix this?

Drag Item From Listbox To Listbox
I was wondering how to drag one item from one listbox to another listbox on the same form...
By using drag and drop, not by using any button..
I choose an item by pressing and holding the button and then drag it to the other listbox..

Also,How do I drag a file from outside my app and into the listbox?
How to use the drag and drop (onto apps listbox) function?

Please provide a simple example(form) if you can
PS: Do it as simple as possible!! No need for extra's!!

I need more help, The examples below didnt work correctly!

Modify A Line In A Text File
hello,

i want to modify a line in my text document(e.g. line 2) and also i want to place it on the third part of the line.
for example: the lines in my text file look like this:

<Meetklokken ,Messf4w ,13-05-2004

and i want to modify the date.
i've tried something but it all didn't work out.
Here is what i have so far:

Code:
Open App.Path & "filename.txt" For Output As #2
Seek #2, i
Write #2, ","; ","; cur_Date
Close #2
where i is the line that i've searched for in another function. So i know already which line i have to modify.

can somebody help me with this?

thanks

Modify Xml And Save To Text File
hi pls help. here's what i want to do.

i have an xml file and i want to remove the tags, place them in a columnar format (tab delimited) and save them to a text file. how will i code it?

example:
xml file

<?xml version ="1.0"?><MEMBER><ABC><TYPE>PERSON</TYPE><NUM>89</NUM><AGE>35</AGE><STATCODE>M</STATCODE><DESC>Married</DESC></ABC><HEADER SEGMENT="1"><NAME>PIA</NAME><TEL>4550095</TEL><HEIGHT>58</HEIGHT><SURNAME>BRIGHT</SURNAME><DETAIL SEGMENT="1"><CITY>NY City</CITY><SALARY>300000</SALARY><COMPANY>POINTBLANK</COMPANY></DETAIL></HEADER></MEMBER>

output text file:
PERSON 89 35 M Married
PIA 4550095 58 BRIGHT
NY City 300000 POINTBLANK

kindly help. thanks!

Modify Mouse-selected Text?
I am looking for examples of how to modify text selected by the user with a mouse. I want to grab the selected string and attach additional text onto the start and end.

Why?

I want to write a script that will allow me to insert unsupported HTML tags using a macro in Frontpage. In FrontPage's "Normal" view I want to select a block of text with the mouse, then by clicking an icon on the toolbar run a macro that inserts the tag and its closing tag around the text, like this:

&lt;mytag&gt;This is the selected text&lt;/mytag&gt;

Where &lt;mytag&gt; and &lt;/mytag&gt; are inserted by the macro.

I don't know much VB, so easy examples would be best.

Thanks in advance!!

Morrissey

How Can I Modify This Code To Search In Non-english Text !?
hi


Code:
#!/usr/local/bin/perl
####################################################################
# URL Search Engine
# Copyright 1996 Techno Trade http://www.technotrade.com
# Written By : Sammy Afifi sammy@technotrade.com
# Date Last Modified : Jan 14, 1997
####################################################################
#
# This script is free of charge.
# Please link back to http://technotrade.com, thank you :-)
#######
#
# Jan 14, stops people from entering html tags, converts < to <
#
####################################################################

# $linktitle, $linkdescrip, $linkwords, $linkemail, $linkurl
# define some global variables

$fields = 5; # Number of fields in each record
$filename = "urls.txt"; # The database text file
$results = 1000; # maximum number of results to display

&parse_form;

$searchstring = $FORM{'searchstring'};

&addrecord if ($searchstring eq "**ADD RECORD**");


&open_file("FILE1","",$filename);

print "Content-type: text/html

";
print "<HTML>
";
print "<BODY BGCOLOR=#FFFFFF TEXT=#000000 LINK=#0000FF VLINK=#800040 ALINK=#800040>
";
print "<TITLE>Search Results</TITLE>
";
print "<CENTER><BR>
";
print "<FONT SIZE=5 COLOR=000000 FACE="ARIAL,TIMES NEW ROMAN"><B>Results :</b></FONT></CENTER>
";

print "<HR width=80% noshade><BR><UL>
";
$counter = 0;

while (($line = &read_file("FILE1")) && ($counter < $results)) {
# split the fields at the | character
@tabledata = split(/s*|s*/,$line ,$fields);
&check_record;
if ($found == 1) {
$counter++;
&print_record;
}

}
close(FILE1);
print "</UL>
";

if ($counter == 0) {
print "<BR><center><B>Sorry ! not found.</B>
";
}


print "<CENTER>
";
print "<HR width=80% noshade>
";
print "</CENTER>
";
print "</A></BODY></HTML>
";



#########################################
#
# Print the matched record
#
#########################################
sub print_record {
print "<BR>
";
print "<LI><A HREF=" . $linkurl . ">" . $linktitle . "</A> : $linkdescrip</B><BR>
";
}


##########################################
#
# Check to see if record matches search criteria
#
##########################################
sub check_record {
# get the data from the record read from the file. $tabledata

$linktitle = $tabledata[0];
$linkdescrip = $tabledata[1];
$linkwords = $tabledata[2];
$linemail = $tabledata[3];
$linkurl = $tabledata[4];
chop($linkurl);

#build the search line with all fields we want to search in
$searchline = $linktitle . " " . $linkdescrip . " " . $linkwords;


#search by keywords
# only perform the keyword search if the length of the search string is greater than 2
# don't think we want people to search for and or or etc.
$sfound = 0;
$found = 0;
$notfound = 1;

$stlen = length($searchstring);
if ($stlen > 1) {
@words = split(/ +/,$searchstring);
foreach $aword (@words) {
if ($searchline =~ /$aword/i) {
$sfound = 1;
}
else {
$notfound = 0;
}
}
}
if ($sfound == 1 && $notfound == 1) {
$found = 1;
}

# if search string is too small .. set found to 1
if ($stlen <= 1) {
$found = 1;
}
#if page doesn't have a title then return not found
$tlen = length($linktitle);
if ($tlen < 1) {
$found = 0;
}
}


############################################
#
# Add Record
#
############################################

sub addrecord {

$linktitle = $FORM{'linktitle'};
$linkdescrip = $FORM{'linkdescrip'};
$linkwords = $FORM{'linkwords'};
$linkemail = $FORM{'linkemail'};
$linkurl = $FORM{'linkurl'};

# Convert < tags to <
$linktitle =~ s/</</g;
$linkdescrip =~ s/</</g;
$linkwords =~ s/</</g;
$linkemail =~ s/</</g;
$linkurl =~ s/</</g;



&open_file("FILE1",">>",$filename);

&write_file("FILE1",$linktitle . "|". $linkdescrip. "|" .$linkwords ."|" .$linkemail ."|" .$linkurl ."
");
close(FILE1);
print "Content-type: text/html

";
print "<html><head><title>Thank You</title></head>
";
print "<body background="/images/bground.gif" bgcolor="#ffffff" text="#000000" marginheight="0" topmargin="0"><BR><h3><CENTER>Thank you !</CENTER></h3>
";
print "</body></html>
";
exit;
}











sub parse_form {

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
if (length($buffer) < 5) {
$buffer = $ENV{QUERY_STRING};
}

@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);

$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

$FORM{$name} = $value;
}
}



sub open_file {

local ($filevar, $filemode, $filename) = @_;

open ($filevar,$filemode . $filename) ||
die ("Can't open $filename");
}

sub read_file {

local ($filevar) = @_;

<$filevar>;
}

sub write_file {

local ($filevar, $line) = @_;

print $filevar ($line);
}


i'm waitting ...

How Do I Modify A Specific Line In A Text File?
I have a specific file that needs to have the last line modified. I have tried to figure out how to put the file into an array, then loop through the array to find the value that needs modifying, and then modify it. I have not been able to determine how to do this yet. Any help would be most appreciated.

How Do I Open, And Modify A Text File From My Asp Page?
Okay I am a bit stumped here hopefully somebody can help me out.. I have a simple ASP page, that reads an XML file and retrieves a text document file name. Then I need find this text document in a directory of many files, then open up this text document, and insert a few lines of code at a specific location in the text document, then close the document.

So for instance, my asp page reads an XML file and comes back with the filename: DB_Install_Path.txt

I then need to search a directory of files for this filename: DB_Install_Path.txt
Once I find this file in the directory, I need to open it up, then insert the following code:
Platform=Windows
Database=Microsoft
Server=SQL_Server01

then I need to save and close the text file. But the trick is, I need to insert the above lines of code at a SPECIFIC location in the text document. So for instance, lets say my text document looks like this (I put line numbers as the side)

1 This is the file DB_Install_Path.txt
2 Please read the directions below.
3 You must install the database on the following platform:
4 'INSERT CODE FROM ASP PAGE HERE'
5 'INSERT CODE FROM ASP PAGE HERE'
6 'INSERT CODE FROM ASP PAGE HERE'
7 After installing database make sure to backup all objects.
8 Please contact support with any questions.

I need to insert the code at lines 4,5 and 6. But the next issue is that I do not know what comes before where I need to insert the code. I only know that I ALWAYS must put the code BEFORE the word "After" on line 7. So it's like I have to loop through the code and then go back up to insert the lines of code I need or something.

If anybody can give me some asp vbscript examples of how I might do this that would be very helpful, thank you!

Last Item In A Listbox
A listbox normaly shows items 1 down to the maximum showable in that box despite of the value of .ListCount . How can I tell VB - after aplying the .AddItem-method - allway to show the .ListCount-item at the last line of the listbox (will say: display items [.ListCount-max. lines] to .ListCount)?

Thanks in advance!

Lightgun

For Each Item In Listbox...
Here is what im Trying to do:

Something like....

For Each Item in Listbox

MsgBox The Data of the item

Next

Its so simple, yet i havnt been able to figure it out =/

Listbox Item Taken Out
Hey, i also need to know how to take away an item from a list. so say i had lstMyList.additem myPerson.name

i would want to take away myPerson.name when i did a certain thing

does anyone know? thanks...Xtrava

Listbox Item
Is it possible to have some kind of short textstring shown with some information when you have the mousepointer over an item in a list box??

If I have the mouse of item 1 it might say "bla bla bla" and if I move it over item 2 "tada tada"

Add Item To ListBox
I'm trying to write a winsock program (but the actual problem doesn't have anything [at least I don't think] to do with Winsock, so I'm posting here). It is a LAN based IM system, and on the server side, it has a list box with connected users. What I'm trying to do is to add the user based on the index of the Winsock object, but I get an "Invalid Procedure Call or Argument" error on that line.

lstUsers.AddItem user(0), Index

user(0) is the user's name, and Index is the Index of the Winsock Object. When I comment out/take out the ", Index" part, the program rusn with no error. Where did I go wrong?

Listbox Value For An Item
I am populating a listibox with items. Is it possible to populate it like a combo in a html form?

I have a list of athlete's and when seleted I want to pull the ID for the athlete. I can already pull the text that is displayed but hoping I can add additional info like in a html combo and when selected display the other info.


VB Code:
...Do While adoRs.EOF = False            lstAvailable.AddItem adoRs.Fields.Item("ATHLETE_NAME").Value            adoRs.MoveNextLoop...


Update: Sorry, I said listview originally, I meant to say listbox.

Thanks for your help in advance.

ListBox Item
I have got a list box on a form, and I'm saving data into an Access Table like this, if 2 options are chosen, I place the first item in the field then I use a (comma), and then place the other option and so on.

Now I want to reverse it and do something like this, want to read that field and whenever it finds a comma , it should place the data in the next line. And I want to put the results in MsgBox and if I have these three items saved in the table: PS2, Newspaper, XBox...I would like them to appear in the MsgBox like This:
PS2
Newspaper
xBox

Any help on that?

Item From Listbox
Hi all,
I'm using a listbox which is containing around 100 items and the contents of listbox are changing after regular intervals. If a user selets an item from listbox, how can i get the name of the selected item?
Help me pls.
Anita.

Listbox ? How Much Item Can I Add ?
i m trying to add items to my listbox and i think that it has a limit of a 32767 items can that happen ?
10x

Each Item In A Listbox
I am trying to step through each item in a listbox, starting with the first item and making my way through each of them. I will be writing the contents of each item to a binary file (I've got all the code for that..). However, I can't seem to figure out how to step through each item in the list box and get its text value. Any suggestions? Thanks in advance!

For Each Item In Listbox...
In vb.net I have a listbox that contains the path to files. Then I used a For Each loop to add each file to the a zip archive. How can I do this in vb 6.0?

VB.net code:
For Each file In ListBox1.Items
'code
Next

Thanks for any help you can provide
Dave

Copyright © 2005-08 www.BigResource.com, All rights reserved