Solved

Maximum Characters in a Listbox?

Posted on 1998-12-17
8
441 Views
Last Modified: 2013-12-03
Can someone tell me if there is a maximum numbers of characters that a line in a list can display - and what the max is?
0
Comment
Question by:spatel121798
  • 4
  • 2
  • 2
8 Comments
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1450925
It's 64K in C++. In VB I don't know. But what is your problem?
 1000 or so characters work without any problem. More becomes useless.
0
 
LVL 2

Accepted Solution

by:
cartti earned 50 total points
ID: 1450926
The maximum number of characters per line for a listbox is 1024.

If you try to add a string greater than that length to a listbox, it will only hold the first 1024 characters.
0
 

Author Comment

by:spatel121798
ID: 1450927
I have designed a utility in VB which reads a text file into a list and strips off certain words from each line etc. I am reading the file into a list - but one sentence can be 2kb - and ive noticed that it gets truncated - because you said it can only hold 1kb. Is there a way round this?

And are there other ways of reading in files that can do specific searches per sentence?
0
 

Author Comment

by:spatel121798
ID: 1450928
Please can someone help me.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Expert Comment

by:cartti
ID: 1450929
I'll have a think about first point.

With searches, are you talking about searching a word within a sentence, or a sentence within a file ?
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1450930
Why not split the line every 1000 characters
0
 

Author Comment

by:spatel121798
ID: 1450931
here is an example of one of my sentences:

<Message:<GroupId:123456><Id:1><Num:11375><Date:17-Apr-1997><Time:14:39:38><Expiry:90><TranStartNum:11239><Collection:TrainingMessage><ObjectName:A_EPOSSProducts1_3011><DateChangeList:<Date:<DateName:StartDate><Type:1>>><Data:<Collection:_EPOSSProducts><ObjectName:3011_00><StartDate:16-June1997> <EndDate:><RData:<Data:<PN:3011><SN:Blu Wat><LN:Blue Sea Water><RN:Blue SeaWater><FP:False><RP:><MV:1.00><SE:In><AS:False><MnV:1.00><MxV:45.00><MnQ:1><MxQ:1><RcptNo:2><SR:True><MP:0><V:0><RV:True><RT:7><RA:APS><SI:TrainingAPScardscheme><IA:><PM:<L1:><L2:3026><L3:3006><L4:3013><L5:3017>><SM:><I:False><ST:><DEP:E><AdditionalData:<F:*><S:Numeric><D:><Max:6><Min:0><VM:><N:APSSEQ><C:><O:0><A:None><SD:>><AdditionalData:<P:TokenType:><F:*><S:Alphanumeric><D:><Max:10><Min:0><VM:><N:TT><C:><O:0><A:Display><SD:<Option:<Text:MagCard><Key:1>><Option:<Text:BarCode><Key:2>>>><AdditionalData:<F:*><S:Date><D:><Max:8><Min:0><VM:><N:AD><C:><O:0><A:None><SD:>><AdditionalData:<F:*><S:Numeric><D:><Max:6><Min:0><VM:><N:CA><C:><O:0><<AdditionalData:<P:Method of Payment:><F:*><S:Options><D:><Max:6><Min:0><VM:><N:MoP><C:MethodPayment><O:99><A:Display><SD:<Option:<Text:Cash><Key:0>><Option:<Text:Cheque><Key:1>>>><AdditionalData:<F:*><S:Alphanumeric><D:><Max:4><Min:0><VM:><N:SVC><C:><O:0><A:None><SD:>><AdditionalData:<F:*><S:Numeric><D:><Max:40><Min:0><VM:><N:CuR><C:><O:0><A:None><SD:>><AdditionalData:<F:*><S:Alphanumeric><D:><Max:4><Min:0><VM:><N:CID><C:><O:0><A:None><SD:>><AdditionalData:<F:*><S:Alphanumeric><D:><Max:2><Min:0><VM:><N:SG><C:><O:0><A:None><SD:>><AdditionalData:<F:*><S:Alphanumeric><Max:10><Min:1><N:TI><O:0><A:None>><AdditionalData:<F:*><S:Alphanumeric><Max:24><Min:1><N:TD><O:0><A:None>><AdditionalData:<F:*><S:Alphanumeric><Max:24><Min:1><N:CN><O:0><A:None>><AdditionalData:<F:*><S:Alphanumeric><Max:10><Min:1><N:TV><O:0><A:None>>>>><Version:1><CRC:C620E1DD>>

basically in this example i am searching for the word "collection" and deleting everything before it. I am also searching for other words in the sentence and stripping off everything after it.

if i was to split the lines up - how would i go about doing it. currently the code i am using to input the file is:

Do While Not EOF(fh) ' Loop until end of file.
    Line Input #fh, textline ' Read line into variable.
    FrmDisplay!List1.AddItem textline    
Loop

Thanks for the help!

0
 

Author Comment

by:spatel121798
ID: 1450932
Also, is there a way of putting a horizontal scroll on my listbox so that i can see the complete sentence?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now