borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2010 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Forum backslash problem fixed)Next Topic (Urgent help Required Please ....) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Text Box Limitations
Poster Message
John
Level: Trainee

Registered: 27-11-2008
Posts: 3

Ads by Lake Quincy Media
icon Text Box Limitations

Hi.

I am new to any sort of programming but am experminting on vb.6 I am creating a coin collection program which I have a "show all" button. The problem is there seems to be a limitation on the textbox I am bringing the results into. My question: Is there a way to create a view box with the text file, I have created already with the 10 fields. It is a comma delim file and each field has quotes ie: "test1","test2","ect.... Are there any SIMPLE examples with using the DEFAULT names given in vb to view this data? I hope I did not confuse everyone reading this a I am very confused.
Hope someone can help.

John

Ads by Lake Quincy Media
27-11-2008 at 04:29 PM
View Profile Send Email to User Show All Posts | Quote Reply
Keithuk
Level: Professor


Registered: 02-11-2006
Posts: 72
icon Re: Text Box Limitations

Welcome to AndreaVB John.

quote:
John wrote:
Hi.

I am new to any sort of programming but am experminting on vb.6 I am creating a coin collection program which I have a "show all" button. The problem is there seems to be a limitation on the textbox I am bringing the results into. My question: Is there a way to create a view box with the text file, I have created already with the 10 fields. It is a comma delim file and each field has quotes ie: "test1","test2","ect.... Are there any SIMPLE examples with using the DEFAULT names given in vb to view this data? I hope I did not confuse everyone reading this a I am very confused.
Hope someone can help.

John


A TextBox isn't that limited if you set the MultiLine property to True at DesignTime. Or you could use a ListBox or ListView with different columns for the different data.  

[Edited by Keithuk on 30-11-2008 at 10:25 PM GMT]

____________________________
Keith

http://www.martin2k.co.uk/forums/

I've been programming with VB for 14 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
30-11-2008 at 10:24 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
John
Level: Trainee

Registered: 27-11-2008
Posts: 3
icon Re: Text Box Limitations

I have a file with say about 700 records and when I list all in my textbox, it only shows roughly showes 300 and does not show the rest (and it truncates the last record in the middle).  I have the multiline set to true. I'll try the listbox/list view and see what happens. Thank for the reply-

John

01-12-2008 at 02:31 PM
View Profile Send Email to User Show All Posts | Quote Reply
admin
Level: Administrator


Registered: 04-04-2002
Posts: 637
icon Re: Text Box Limitations

I don't know if I remember correctly but the TextBox is limited to 32000 (or 64000) characters, so once you reach this limit the text is truncated. as suggested by Keithuk you should try using a listbox, it will surely work better!

____________________________
AndreaVB

01-12-2008 at 03:23 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
Keithuk
Level: Professor


Registered: 02-11-2006
Posts: 72
icon Re: Text Box Limitations

quote:
John wrote:
I have a file with say about 700 records and when I list all in my textbox, it only shows roughly showes 300 and does not show the rest (and it truncates the last record in the middle).  I have the multiline set to true. I'll try the listbox/list view and see what happens.


Yes John as Admin says there is a limit to the characters in a TextBox. I have a database app that has 86,500 records I and I use a ListView to view them. I don't mean 86,500 in one go but it will show 8000 no problem.  

____________________________
Keith

http://www.martin2k.co.uk/forums/

I've been programming with VB for 14 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
01-12-2008 at 09:39 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
John
Level: Trainee

Registered: 27-11-2008
Posts: 3
icon Re: Text Box Limitations

I'll give it a try. Is there a way to add the context of a file in the listbox on load - like... c:\test\data.dat with 10 fields in the record? .... just tried it but data did not show in listbox. What am I doing wrong?

02-12-2008 at 01:19 AM
View Profile Send Email to User Show All Posts | Quote Reply
admin
Level: Administrator


Registered: 04-04-2002
Posts: 637
icon Re: Text Box Limitations

try this code if it helps,

create a new project with a form, add reference to Microsoft Windows Common Controls 6 and add a listview to your form, then add this code, then try to load your records inside the listview


Option Explicit

Private Sub Form_Load()
    Dim i As Integer
    Dim mItem As ListItem
    
    For i = 1 To 10
        ListView1.ColumnHeaders.Add , , "Column " & i
    Next
    ListView1.View = lvwReport
    'load data inside list
    'repeat this code for every record of your file to
    'fill the ten fields of the row
    Set mItem = ListView1.ListItems.Add(, , "data 1")
    For i = 2 To 10
        mItem.SubItems(i - 1) = "data " & i
    Next
    '--------------------------
End Sub

Private Sub Form_Resize()
    ListView1.Move 0, 0, ScaleWidth, ScaleHeight
End Sub



____________________________
AndreaVB

02-12-2008 at 04:58 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : VB General : Text Box Limitations
Previous Topic (Forum backslash problem fixed)Next Topic (Urgent help Required Please ....) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2010 Andrea Tincaniborder