Can't write in a text box

  • Thread starter Thread starter simonc
  • Start date Start date
S

simonc

Help! I've created a text box which won't let me write in
it. It opens ready filled with text to the limit of the
number of characters which I've set (MaxLength=3200) and
this is in 40 lines of 80 characters. I can delete
characters using the keyboard, but when I try to add in
any text in place of the deleted characters nothing is
input and the cursor stays in the same place. If I output
textbox1.text I can verify that the deleted characters are
missing, and that nothing has been added. I've compared
all the parameters with another text box in another
program which will let me input from the keyboard, and
everything looks the same.

Can anyone suggest why this text box won't accept keyboard
input?

Thanks
 
Hi Simonc,

Can it bee you made 40*80 charachter lines plus a vbcrlf charachter so that
is
40*80 + 40*1 = 3240 characters.

I think that you can delete till 3200 and not insert.
When you come at 3199 you can starting inserting again.

Just a thought?

I am curious if it was this.?

Cor
 
Cor

You are right that the problem was in the specification of
the maximum length. In fact it turns out that vbCrLf
counts as two characters. What confused me was that
despite specifying the max length of the text box when I
loaded text into it (textbox.text = strHeader) it
displayed more than this number of characters.

Many thanks for your help

Simon
 
Simonc,
the maximum length. In fact it turns out that vbCrLf
counts as two characters.

Of course it are Carrier Returen character and the LineFeed character,
I knew it, but I told you I was myself curious if this was the problem.

I am happy we found your problem

Cor
 
Hi Simon,

It is confusing because the Designer doesn't enforce the MaxLength.
You can put any amount in through code. MaxLength only takes effect when the
User types or pastes text.

Regards,
Fergus

ps. Cor, good thinking - this had me stumped last night but all is clear now.
;-)
 
Back
Top