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

TextBoxes

Hi everybody
Textboxes in VS behave in a strange way! I have set the "maximum"
property of the textbox to 0, letting virtually no limitation for the
text entered in it.

I put an OpenDialogFile on the form, and a TextBox.
The following code is used to open the file into the textbox:

If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
Dim sr As New IO.StreamReader(OpenFileDialog1.FileName)
TextBox1.Text = sr.ReadToEnd
sr.Close()
End If

This works really fine in WINDOWS XP.

But in WINDOWS 98, when I open a file- larger than about 33KB- without
any error, nothing appears in the textbox. For files less than 33KB
the code works fine. (I can open files larger than 2^15 = 32768)

What can I do?
Nov 20 '05 #1
8 1128
Hi MS,

Here's the question: can you append characters to the text in the textbox
that has reached its limit? If the answer is yes, then it's simply a matter
of getting the file in 32k chunks and appending to a string object and then
inserting it into the textbox. On the other hand, if you can't, then the 16
bit elements of win 98 will simply not let you and you may be unable to do
anything about it.

Another idea: test dumping sr.readtoend into a string to see if the string
variable can take it - that way you can determine if the string in 98, as
opposed to the textbox.text, is the limitation.

HTH,

Bernie Yaeger

"MSDousti" <MS******@myrealbox.com> wrote in message
news:bf**************************@posting.google.c om...
Hi everybody
Textboxes in VS behave in a strange way! I have set the "maximum"
property of the textbox to 0, letting virtually no limitation for the
text entered in it.

I put an OpenDialogFile on the form, and a TextBox.
The following code is used to open the file into the textbox:

If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
Dim sr As New IO.StreamReader(OpenFileDialog1.FileName)
TextBox1.Text = sr.ReadToEnd
sr.Close()
End If

This works really fine in WINDOWS XP.

But in WINDOWS 98, when I open a file- larger than about 33KB- without
any error, nothing appears in the textbox. For files less than 33KB
the code works fine. (I can open files larger than 2^15 = 32768)

What can I do?

Nov 20 '05 #2
some versions of text boxes have caracter length limitations... some have
32K limitation... so if you put 33K into it, there will be an exception
which would cause nothing to show... i think 9x worked that way..
"MSDousti" <MS******@myrealbox.com> wrote in message
news:bf**************************@posting.google.c om...
Hi everybody
Textboxes in VS behave in a strange way! I have set the "maximum"
property of the textbox to 0, letting virtually no limitation for the
text entered in it.

I put an OpenDialogFile on the form, and a TextBox.
The following code is used to open the file into the textbox:

If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
Dim sr As New IO.StreamReader(OpenFileDialog1.FileName)
TextBox1.Text = sr.ReadToEnd
sr.Close()
End If

This works really fine in WINDOWS XP.

But in WINDOWS 98, when I open a file- larger than about 33KB- without
any error, nothing appears in the textbox. For files less than 33KB
the code works fine. (I can open files larger than 2^15 = 32768)

What can I do?

Nov 20 '05 #3
Hi,

Why dont you try the richtextbox instead.

http://msdn.microsoft.com/library/de...classtopic.asp

Ken
--------------------
"MSDousti" <MS******@myrealbox.com> wrote in message
news:bf**************************@posting.google.c om...
Hi everybody
Textboxes in VS behave in a strange way! I have set the "maximum"
property of the textbox to 0, letting virtually no limitation for the
text entered in it.

I put an OpenDialogFile on the form, and a TextBox.
The following code is used to open the file into the textbox:

If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
Dim sr As New IO.StreamReader(OpenFileDialog1.FileName)
TextBox1.Text = sr.ReadToEnd
sr.Close()
End If

This works really fine in WINDOWS XP.

But in WINDOWS 98, when I open a file- larger than about 33KB- without
any error, nothing appears in the textbox. For files less than 33KB
the code works fine. (I can open files larger than 2^15 = 32768)

What can I do?

Nov 20 '05 #4
* MS******@myrealbox.com (MSDousti) scripsit:
Textboxes in VS behave in a strange way! I have set the "maximum"
property of the textbox to 0, letting virtually no limitation for the
text entered in it.

I put an OpenDialogFile on the form, and a TextBox.
The following code is used to open the file into the textbox:

If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
Dim sr As New IO.StreamReader(OpenFileDialog1.FileName)
TextBox1.Text = sr.ReadToEnd
sr.Close()
End If

This works really fine in WINDOWS XP.

But in WINDOWS 98, when I open a file- larger than about 33KB- without
any error, nothing appears in the textbox. For files less than 33KB
the code works fine. (I can open files larger than 2^15 = 32768)


That's a limitation for the TextBox control on Windows 98/Me. You may
want to use a RichTextBox control instead which can hold much more data.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:<OO**************@TK2MSFTNGP09.phx.gbl>...
Hi,

Why dont you try the richtextbox instead.


RichTextBoxes are very slow!
for example, a 1MB file which takes about 1 Second to load into a
TextBox, takes more than three minutes to load into a RichTextBox.
Even if I load the file with this code:

RichTextBox1.LoadFile(OpenFileDialog1.FileName, _
RichTextBoxStreamType.RichNoOleObjs)

Any idea for more speed?
Nov 20 '05 #6
Cor
Hi MSdousti,

You did ask the same question on 27 of January, did you try the advices or
are you only telling us that your solution does not work?

You where telling then that the stringbuilder did work on W'98 but did on
XP, however when we did ask for your code there was no Stringbuilder code
there and you said you had pasted it out because this was better but did
also not work.

There where some different advices,

Did you try those,

The only thing we see here is that you say that your solution should work or
that the Richtextbox is to slow and sentences in the same way.

We are also intrested in the results from an advice which has the trend to
do some examination.

Cor
Nov 20 '05 #7
Dear Cor
If u revisit that posting, u will see that I answered u about my
sourcecode but get no reply. That's why I started a new saying here. I
have tried all the ways u and the others offered me, but I got no
solution. The problem was not StringBuilders, forgot it please, for
the sake of God! The problem is TextBoxes implementation in windows
98. I tried another solutions like RichTextBoxes and understood that
they are too slow because they support a lot more than I need. I wish
that somebody helped me here.

Thnx for ur interest an advices.
Sincerely urs,
MSDousti

"Cor" <no*@non.com> wrote in message news:<uj**************@TK2MSFTNGP11.phx.gbl>...
Hi MSdousti,

You did ask the same question on 27 of January, did you try the advices or
are you only telling us that your solution does not work?

You where telling then that the stringbuilder did work on W'98 but did on
XP, however when we did ask for your code there was no Stringbuilder code
there and you said you had pasted it out because this was better but did
also not work.

There where some different advices,

Did you try those,

The only thing we see here is that you say that your solution should work or
that the Richtextbox is to slow and sentences in the same way.

We are also intrested in the results from an advice which has the trend to
do some examination.

Cor

Nov 20 '05 #8
Cor
Hi MSDousti,

But did you test a combination of the answers.
Reading it in with stringwriter and than let that string go in one time to
the RichTextbox

And did you something to try on W9x in pseudo beneath

im mystring as new stringbuilder
dfor i as integer = 0 to 3300
mystring.add("abcdefghij")
next
mytextbox.text = mystring.tostring

and if an error what time would it take with this

myrichtextbox.text = mystring.tostring

That was the main reason that I did ask this question.

Cor
If u revisit that posting, u will see that I answered u about my
sourcecode but get no reply. That's why I started a new saying here. I
have tried all the ways u and the others offered me, but I got no
solution. The problem was not StringBuilders, forgot it please, for
the sake of God! The problem is TextBoxes implementation in windows
98. I tried another solutions like RichTextBoxes and understood that
they are too slow because they support a lot more than I need. I wish
that somebody helped me here.

Nov 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: T. Wintershoven | last post by:
Hello, I have a few textboxes placed on a SSTab control devided over 3 tabs Is there a way to clear all textboxes in one time in stead of one by one. Someone told me "Use for each item...
7
by: Drew | last post by:
I have a db table like the following, UID, int auto-increment RegNo Person Relation YearsKnown Now here is some sample data from this table,
1
by: Edlueze | last post by:
I have a number of forms with large textboxes for the purposes of editing memo fields, and just recently I've noticed some bizarre behavior. For some textboxes the END and HOME keys do nothing,...
11
by: ian.davies52 | last post by:
Is there anything I can do about the apparent limit on the number of textboxes that have calculations as their control source on a form or report in ms-access? I have a query that pulls together...
4
by: Jason M | last post by:
Hi, Im very new to c#, so forgive me if this is a really stupid question. Im trying to create a form for entering purchase requests. For each line item I have a quantity, a description unit cost...
1
by: Newbie | last post by:
hello, i have a 14 textboxes and 14 requiredfieldvalidator controls to validate the textboxes. if one or more of the textboxes is empty, the corresponding requiredfieldvalidator controls show...
0
by: Drew | last post by:
Hey, i am currently looking for a nice solution for the following problem ( i could not find a sufficient solution in the other postings ): I am having several textboxes on my page, some of them...
1
by: amurra06 | last post by:
I have a form that contains a tabpage and in that tabpage is a usercontrol that conatins a bunch of textboxes. I have arranged these textboxes in groupboxes to organize them better. What I do is to...
8
by: clintonG | last post by:
I have to get to this later tonight or tommorrow...and wonder... There's two TextBoxes in a Wizard Step posing an either-or situtation. Only one or the other TextBox may pass data. The...
3
by: sakhan | last post by:
Hello Friends, I want to create a row of 10 textboxes each time I click the add button. I want this to continue till it reaches five hundred I am using AJAX for this. It doesnot create 10...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.