ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Userform Textbox - fundamental flaw (https://www.excelbanter.com/excel-programming/326442-userform-textbox-fundamental-flaw.html)

Stuart[_21_]

Userform Textbox - fundamental flaw
 
Oops, just discovered a flaw (probably one of many to come).
The form is designed to represent an A4 page in portrait mode, where
basically the bottom two thirds are occupied by one large textbox.

If I go into this textbox and keep pressing Enter, I can get to the very
bottom of the textbox and I can enter text.

But if I then press Enter the textbox scrolls up the form,
giving the user the impression that the textbox is expanding to meet the
user's needs.

Can I stop this, please?

Regards.



Tom Ogilvy

Userform Textbox - fundamental flaw
 
How about using the maxlength property.

--
Regards,
Tom Ogilvy


"Stuart" wrote in message
...
Oops, just discovered a flaw (probably one of many to come).
The form is designed to represent an A4 page in portrait mode, where
basically the bottom two thirds are occupied by one large textbox.

If I go into this textbox and keep pressing Enter, I can get to the very
bottom of the textbox and I can enter text.

But if I then press Enter the textbox scrolls up the form,
giving the user the impression that the textbox is expanding to meet the
user's needs.

Can I stop this, please?

Regards.





Stuart[_21_]

Userform Textbox - fundamental flaw
 
Rollocks!...should have looked at the available properties
for a textbox before posting.
Apologies.

Regards.

"Tom Ogilvy" wrote in message
...
How about using the maxlength property.

--
Regards,
Tom Ogilvy


"Stuart" wrote in message
...
Oops, just discovered a flaw (probably one of many to come).
The form is designed to represent an A4 page in portrait mode, where
basically the bottom two thirds are occupied by one large textbox.

If I go into this textbox and keep pressing Enter, I can get to the very
bottom of the textbox and I can enter text.

But if I then press Enter the textbox scrolls up the form,
giving the user the impression that the textbox is expanding to meet the
user's needs.

Can I stop this, please?

Regards.







Stuart[_21_]

Userform Textbox - fundamental flaw
 
Perhaps not as simple, as simple me, first thought.

The textbox's height property is set to 419.25 (which I believe is a value
in points) and the width to 102.
The Font is set to Times New Roman, FontSize to 12 and Bold.

Help for MaxLength gives one option:
MaxLength Property (Forms)
which says I can set the maximum number of characters in the
textbox.................

I have absolutely no idea how I can calculate that.

Help please.

Regards.




Tom Ogilvy" wrote in message
...
How about using the maxlength property.

--
Regards,
Tom Ogilvy


"Stuart" wrote in message
...
Oops, just discovered a flaw (probably one of many to come).
The form is designed to represent an A4 page in portrait mode, where
basically the bottom two thirds are occupied by one large textbox.

If I go into this textbox and keep pressing Enter, I can get to the very
bottom of the textbox and I can enter text.

But if I then press Enter the textbox scrolls up the form,
giving the user the impression that the textbox is expanding to meet the
user's needs.

Can I stop this, please?

Regards.







NickHK

Userform Textbox - fundamental flaw
 
Stuart,
Using a fixed width font will make this easier.
If you must use a proportional width font, fill the text box with "W" and
use that number of caharacters.

NickHK

"Stuart" wrote in message
...
Perhaps not as simple, as simple me, first thought.

The textbox's height property is set to 419.25 (which I believe is a value
in points) and the width to 102.
The Font is set to Times New Roman, FontSize to 12 and Bold.

Help for MaxLength gives one option:
MaxLength Property (Forms)
which says I can set the maximum number of characters in the
textbox.................

I have absolutely no idea how I can calculate that.

Help please.

Regards.




Tom Ogilvy" wrote in message
...
How about using the maxlength property.

--
Regards,
Tom Ogilvy


"Stuart" wrote in message
...
Oops, just discovered a flaw (probably one of many to come).
The form is designed to represent an A4 page in portrait mode, where
basically the bottom two thirds are occupied by one large textbox.

If I go into this textbox and keep pressing Enter, I can get to the

very
bottom of the textbox and I can enter text.

But if I then press Enter the textbox scrolls up the form,
giving the user the impression that the textbox is expanding to meet

the
user's needs.

Can I stop this, please?

Regards.









Stuart[_21_]

Userform Textbox - fundamental flaw
 
Many thanks for that, but I don't think this is leading me in the right
direction.

Here's what I have now:
a multiline textbox set to Times New Roman (size 12)
text is Bold, wraptext is enabled. The Enter and Tab
keys are enabled. When the form displays, I can press
the Enter down to line 29 before the textbox begins to
scroll --- this is the bottom-most line of the printed
output.
If the user types anywhere after this line, then the top lines
in the textbox will be omitted from the printed copy. So I
wish to limit usage to this line.
Thus user could use Enter and Tab to get to the very end
of line 29 and say type a W (there would be no characters before the W), but
the form would then not scroll, despite their only being one visible
character in the
form.

Can this be done, please?

Regards and thanks.

NickHK" wrote in message
...
Stuart,
Using a fixed width font will make this easier.
If you must use a proportional width font, fill the text box with "W" and
use that number of caharacters.

NickHK

"Stuart" wrote in message
...
Perhaps not as simple, as simple me, first thought.

The textbox's height property is set to 419.25 (which I believe is a
value
in points) and the width to 102.
The Font is set to Times New Roman, FontSize to 12 and Bold.

Help for MaxLength gives one option:
MaxLength Property (Forms)
which says I can set the maximum number of characters in the
textbox.................

I have absolutely no idea how I can calculate that.

Help please.

Regards.




Tom Ogilvy" wrote in message
...
How about using the maxlength property.

--
Regards,
Tom Ogilvy


"Stuart" wrote in message
...
Oops, just discovered a flaw (probably one of many to come).
The form is designed to represent an A4 page in portrait mode, where
basically the bottom two thirds are occupied by one large textbox.

If I go into this textbox and keep pressing Enter, I can get to the

very
bottom of the textbox and I can enter text.

But if I then press Enter the textbox scrolls up the form,
giving the user the impression that the textbox is expanding to meet

the
user's needs.

Can I stop this, please?

Regards.











NickHK

Userform Textbox - fundamental flaw
 
Stuart,
May be this help then.

http://vbnet.mvps.org/code/textapi/txboxlines.htm

NickHK

"Stuart" wrote in message
...
Many thanks for that, but I don't think this is leading me in the right
direction.

Here's what I have now:
a multiline textbox set to Times New Roman (size 12)
text is Bold, wraptext is enabled. The Enter and Tab
keys are enabled. When the form displays, I can press
the Enter down to line 29 before the textbox begins to
scroll --- this is the bottom-most line of the printed
output.
If the user types anywhere after this line, then the top lines
in the textbox will be omitted from the printed copy. So I
wish to limit usage to this line.
Thus user could use Enter and Tab to get to the very end
of line 29 and say type a W (there would be no characters before the W),

but
the form would then not scroll, despite their only being one visible
character in the
form.

Can this be done, please?

Regards and thanks.

NickHK" wrote in message
...
Stuart,
Using a fixed width font will make this easier.
If you must use a proportional width font, fill the text box with "W"

and
use that number of caharacters.

NickHK

"Stuart" wrote in message
...
Perhaps not as simple, as simple me, first thought.

The textbox's height property is set to 419.25 (which I believe is a
value
in points) and the width to 102.
The Font is set to Times New Roman, FontSize to 12 and Bold.

Help for MaxLength gives one option:
MaxLength Property (Forms)
which says I can set the maximum number of characters in the
textbox.................

I have absolutely no idea how I can calculate that.

Help please.

Regards.




Tom Ogilvy" wrote in message
...
How about using the maxlength property.

--
Regards,
Tom Ogilvy


"Stuart" wrote in message
...
Oops, just discovered a flaw (probably one of many to come).
The form is designed to represent an A4 page in portrait mode, where
basically the bottom two thirds are occupied by one large textbox.

If I go into this textbox and keep pressing Enter, I can get to the

very
bottom of the textbox and I can enter text.

But if I then press Enter the textbox scrolls up the form,
giving the user the impression that the textbox is expanding to meet

the
user's needs.

Can I stop this, please?

Regards.













Stuart[_21_]

Userform Textbox - fundamental flaw
 
Thanks. I'm trying to make it work, but it fails on the line beginning:
lineCount =
with the message "Method or data member not found"
..hwnd is highlighted.
Can I adapt this for VBA?

Regards.

"NickHK" wrote in message
...
Stuart,
May be this help then.

http://vbnet.mvps.org/code/textapi/txboxlines.htm

NickHK

"Stuart" wrote in message
...
Many thanks for that, but I don't think this is leading me in the right
direction.

Here's what I have now:
a multiline textbox set to Times New Roman (size 12)
text is Bold, wraptext is enabled. The Enter and Tab
keys are enabled. When the form displays, I can press
the Enter down to line 29 before the textbox begins to
scroll --- this is the bottom-most line of the printed
output.
If the user types anywhere after this line, then the top lines
in the textbox will be omitted from the printed copy. So I
wish to limit usage to this line.
Thus user could use Enter and Tab to get to the very end
of line 29 and say type a W (there would be no characters before the W),

but
the form would then not scroll, despite their only being one visible
character in the
form.

Can this be done, please?

Regards and thanks.

NickHK" wrote in message
...
Stuart,
Using a fixed width font will make this easier.
If you must use a proportional width font, fill the text box with "W"

and
use that number of caharacters.

NickHK

"Stuart" wrote in message
...
Perhaps not as simple, as simple me, first thought.

The textbox's height property is set to 419.25 (which I believe is a
value
in points) and the width to 102.
The Font is set to Times New Roman, FontSize to 12 and Bold.

Help for MaxLength gives one option:
MaxLength Property (Forms)
which says I can set the maximum number of characters in the
textbox.................

I have absolutely no idea how I can calculate that.

Help please.

Regards.




Tom Ogilvy" wrote in message
...
How about using the maxlength property.

--
Regards,
Tom Ogilvy


"Stuart" wrote in message
...
Oops, just discovered a flaw (probably one of many to come).
The form is designed to represent an A4 page in portrait mode,
where
basically the bottom two thirds are occupied by one large textbox.

If I go into this textbox and keep pressing Enter, I can get to the
very
bottom of the textbox and I can enter text.

But if I then press Enter the textbox scrolls up the form,
giving the user the impression that the textbox is expanding to
meet
the
user's needs.

Can I stop this, please?

Regards.















NickHK

Userform Textbox - fundamental flaw
 
Stuart,
Sorry forgot you're in VBA.
How about a RichTextBox instead. It has a .HWnd property.

NickHK


"Stuart" wrote in message
...
Thanks. I'm trying to make it work, but it fails on the line beginning:
lineCount =
with the message "Method or data member not found"
.hwnd is highlighted.
Can I adapt this for VBA?

Regards.

"NickHK" wrote in message
...
Stuart,
May be this help then.

http://vbnet.mvps.org/code/textapi/txboxlines.htm

NickHK

"Stuart" wrote in message
...
Many thanks for that, but I don't think this is leading me in the right
direction.

Here's what I have now:
a multiline textbox set to Times New Roman (size 12)
text is Bold, wraptext is enabled. The Enter and Tab
keys are enabled. When the form displays, I can press
the Enter down to line 29 before the textbox begins to
scroll --- this is the bottom-most line of the printed
output.
If the user types anywhere after this line, then the top lines
in the textbox will be omitted from the printed copy. So I
wish to limit usage to this line.
Thus user could use Enter and Tab to get to the very end
of line 29 and say type a W (there would be no characters before the

W),
but
the form would then not scroll, despite their only being one visible
character in the
form.

Can this be done, please?

Regards and thanks.

NickHK" wrote in message
...
Stuart,
Using a fixed width font will make this easier.
If you must use a proportional width font, fill the text box with "W"

and
use that number of caharacters.

NickHK

"Stuart" wrote in message
...
Perhaps not as simple, as simple me, first thought.

The textbox's height property is set to 419.25 (which I believe is a
value
in points) and the width to 102.
The Font is set to Times New Roman, FontSize to 12 and Bold.

Help for MaxLength gives one option:
MaxLength Property (Forms)
which says I can set the maximum number of characters in the
textbox.................

I have absolutely no idea how I can calculate that.

Help please.

Regards.




Tom Ogilvy" wrote in message
...
How about using the maxlength property.

--
Regards,
Tom Ogilvy


"Stuart" wrote in message
...
Oops, just discovered a flaw (probably one of many to come).
The form is designed to represent an A4 page in portrait mode,
where
basically the bottom two thirds are occupied by one large

textbox.

If I go into this textbox and keep pressing Enter, I can get to

the
very
bottom of the textbox and I can enter text.

But if I then press Enter the textbox scrolls up the form,
giving the user the impression that the textbox is expanding to
meet
the
user's needs.

Can I stop this, please?

Regards.

















Stuart[_21_]

Userform Textbox - fundamental flaw
 
I'll give it a try, but can't see anything in Help about it.

Regards.

"NickHK" wrote in message
...
Stuart,
Sorry forgot you're in VBA.
How about a RichTextBox instead. It has a .HWnd property.

NickHK


"Stuart" wrote in message
...
Thanks. I'm trying to make it work, but it fails on the line beginning:
lineCount =
with the message "Method or data member not found"
.hwnd is highlighted.
Can I adapt this for VBA?

Regards.

"NickHK" wrote in message
...
Stuart,
May be this help then.

http://vbnet.mvps.org/code/textapi/txboxlines.htm

NickHK

"Stuart" wrote in message
...
Many thanks for that, but I don't think this is leading me in the
right
direction.

Here's what I have now:
a multiline textbox set to Times New Roman (size 12)
text is Bold, wraptext is enabled. The Enter and Tab
keys are enabled. When the form displays, I can press
the Enter down to line 29 before the textbox begins to
scroll --- this is the bottom-most line of the printed
output.
If the user types anywhere after this line, then the top lines
in the textbox will be omitted from the printed copy. So I
wish to limit usage to this line.
Thus user could use Enter and Tab to get to the very end
of line 29 and say type a W (there would be no characters before the

W),
but
the form would then not scroll, despite their only being one visible
character in the
form.

Can this be done, please?

Regards and thanks.

NickHK" wrote in message
...
Stuart,
Using a fixed width font will make this easier.
If you must use a proportional width font, fill the text box with
"W"
and
use that number of caharacters.

NickHK

"Stuart" wrote in message
...
Perhaps not as simple, as simple me, first thought.

The textbox's height property is set to 419.25 (which I believe is
a
value
in points) and the width to 102.
The Font is set to Times New Roman, FontSize to 12 and Bold.

Help for MaxLength gives one option:
MaxLength Property (Forms)
which says I can set the maximum number of characters in the
textbox.................

I have absolutely no idea how I can calculate that.

Help please.

Regards.




Tom Ogilvy" wrote in message
...
How about using the maxlength property.

--
Regards,
Tom Ogilvy


"Stuart" wrote in message
...
Oops, just discovered a flaw (probably one of many to come).
The form is designed to represent an A4 page in portrait mode,
where
basically the bottom two thirds are occupied by one large

textbox.

If I go into this textbox and keep pressing Enter, I can get to

the
very
bottom of the textbox and I can enter text.

But if I then press Enter the textbox scrolls up the form,
giving the user the impression that the textbox is expanding to
meet
the
user's needs.

Can I stop this, please?

Regards.



















Tom Ogilvy

Userform Textbox - fundamental flaw
 
It isn't distributed with Excel.


Here are some sources of INFO:

http://support.microsoft.com/default...b;en-us;838010
Problems occur when you use the Rich TextBox Control 6.0 in Office XP and in
Office 2003

http://support.microsoft.com/default...b;en-us;236286
Out of memory error message using the Rich Textbox control

http://support.microsoft.com/default...b;en-us;297391
OFFXPDEV: ActiveX Controls That Are Included with Microsoft Office XP
Developer

http://support.microsoft.com/default...b;en-us;257849
How To Resize RichTextbox Control with Endless Bottom



http://www.developerfusion.com/show/16/


--
Regards,
Tom Ogilvy

"Stuart" wrote in message
...
I'll give it a try, but can't see anything in Help about it.

Regards.

"NickHK" wrote in message
...
Stuart,
Sorry forgot you're in VBA.
How about a RichTextBox instead. It has a .HWnd property.

NickHK


"Stuart" wrote in message
...
Thanks. I'm trying to make it work, but it fails on the line beginning:
lineCount =
with the message "Method or data member not found"
.hwnd is highlighted.
Can I adapt this for VBA?

Regards.

"NickHK" wrote in message
...
Stuart,
May be this help then.

http://vbnet.mvps.org/code/textapi/txboxlines.htm

NickHK

"Stuart" wrote in message
...
Many thanks for that, but I don't think this is leading me in the
right
direction.

Here's what I have now:
a multiline textbox set to Times New Roman (size 12)
text is Bold, wraptext is enabled. The Enter and Tab
keys are enabled. When the form displays, I can press
the Enter down to line 29 before the textbox begins to
scroll --- this is the bottom-most line of the printed
output.
If the user types anywhere after this line, then the top lines
in the textbox will be omitted from the printed copy. So I
wish to limit usage to this line.
Thus user could use Enter and Tab to get to the very end
of line 29 and say type a W (there would be no characters before the

W),
but
the form would then not scroll, despite their only being one visible
character in the
form.

Can this be done, please?

Regards and thanks.

NickHK" wrote in message
...
Stuart,
Using a fixed width font will make this easier.
If you must use a proportional width font, fill the text box with
"W"
and
use that number of caharacters.

NickHK

"Stuart" wrote in message
...
Perhaps not as simple, as simple me, first thought.

The textbox's height property is set to 419.25 (which I believe

is
a
value
in points) and the width to 102.
The Font is set to Times New Roman, FontSize to 12 and Bold.

Help for MaxLength gives one option:
MaxLength Property (Forms)
which says I can set the maximum number of characters in the
textbox.................

I have absolutely no idea how I can calculate that.

Help please.

Regards.




Tom Ogilvy" wrote in message
...
How about using the maxlength property.

--
Regards,
Tom Ogilvy


"Stuart" wrote in message
...
Oops, just discovered a flaw (probably one of many to come).
The form is designed to represent an A4 page in portrait mode,
where
basically the bottom two thirds are occupied by one large

textbox.

If I go into this textbox and keep pressing Enter, I can get

to
the
very
bottom of the textbox and I can enter text.

But if I then press Enter the textbox scrolls up the form,
giving the user the impression that the textbox is expanding

to
meet
the
user's needs.

Can I stop this, please?

Regards.





















Stuart[_21_]

Userform Textbox - fundamental flaw
 
Wondered about that.

Thanks again for your help/time.

Regards.

"Tom Ogilvy" wrote in message
...
It isn't distributed with Excel.


Here are some sources of INFO:

http://support.microsoft.com/default...b;en-us;838010
Problems occur when you use the Rich TextBox Control 6.0 in Office XP and
in
Office 2003

http://support.microsoft.com/default...b;en-us;236286
Out of memory error message using the Rich Textbox control

http://support.microsoft.com/default...b;en-us;297391
OFFXPDEV: ActiveX Controls That Are Included with Microsoft Office XP
Developer

http://support.microsoft.com/default...b;en-us;257849
How To Resize RichTextbox Control with Endless Bottom



http://www.developerfusion.com/show/16/


--
Regards,
Tom Ogilvy

"Stuart" wrote in message
...
I'll give it a try, but can't see anything in Help about it.

Regards.

"NickHK" wrote in message
...
Stuart,
Sorry forgot you're in VBA.
How about a RichTextBox instead. It has a .HWnd property.

NickHK


"Stuart" wrote in message
...
Thanks. I'm trying to make it work, but it fails on the line
beginning:
lineCount =
with the message "Method or data member not found"
.hwnd is highlighted.
Can I adapt this for VBA?

Regards.

"NickHK" wrote in message
...
Stuart,
May be this help then.

http://vbnet.mvps.org/code/textapi/txboxlines.htm

NickHK

"Stuart" wrote in message
...
Many thanks for that, but I don't think this is leading me in the
right
direction.

Here's what I have now:
a multiline textbox set to Times New Roman (size 12)
text is Bold, wraptext is enabled. The Enter and Tab
keys are enabled. When the form displays, I can press
the Enter down to line 29 before the textbox begins to
scroll --- this is the bottom-most line of the printed
output.
If the user types anywhere after this line, then the top lines
in the textbox will be omitted from the printed copy. So I
wish to limit usage to this line.
Thus user could use Enter and Tab to get to the very end
of line 29 and say type a W (there would be no characters before
the
W),
but
the form would then not scroll, despite their only being one
visible
character in the
form.

Can this be done, please?

Regards and thanks.

NickHK" wrote in message
...
Stuart,
Using a fixed width font will make this easier.
If you must use a proportional width font, fill the text box with
"W"
and
use that number of caharacters.

NickHK

"Stuart" wrote in message
...
Perhaps not as simple, as simple me, first thought.

The textbox's height property is set to 419.25 (which I believe

is
a
value
in points) and the width to 102.
The Font is set to Times New Roman, FontSize to 12 and Bold.

Help for MaxLength gives one option:
MaxLength Property (Forms)
which says I can set the maximum number of characters in the
textbox.................

I have absolutely no idea how I can calculate that.

Help please.

Regards.




Tom Ogilvy" wrote in message
...
How about using the maxlength property.

--
Regards,
Tom Ogilvy


"Stuart" wrote in message
...
Oops, just discovered a flaw (probably one of many to come).
The form is designed to represent an A4 page in portrait
mode,
where
basically the bottom two thirds are occupied by one large
textbox.

If I go into this textbox and keep pressing Enter, I can get

to
the
very
bottom of the textbox and I can enter text.

But if I then press Enter the textbox scrolls up the form,
giving the user the impression that the textbox is expanding

to
meet
the
user's needs.

Can I stop this, please?

Regards.
























All times are GMT +1. The time now is 05:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com