+ Reply to Thread
Results 1 to 12 of 12

Userform Textbox - fundamental flaw

  1. #1
    Stuart
    Guest

    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.



  2. #2
    Tom Ogilvy
    Guest

    Re: Userform Textbox - fundamental flaw

    How about using the maxlength property.

    --
    Regards,
    Tom Ogilvy


    "Stuart" <[email protected]> wrote in message
    news:[email protected]...
    > 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.
    >
    >




  3. #3
    Stuart
    Guest

    Re: Userform Textbox - fundamental flaw

    Rollocks!...should have looked at the available properties
    for a textbox before posting.
    Apologies.

    Regards.

    "Tom Ogilvy" <[email protected]> wrote in message
    news:[email protected]...
    > How about using the maxlength property.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Stuart" <[email protected]> wrote in message
    > news:[email protected]...
    >> 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.
    >>
    >>

    >
    >




  4. #4
    Stuart
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > How about using the maxlength property.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Stuart" <[email protected]> wrote in message
    > news:[email protected]...
    >> 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.
    >>
    >>

    >
    >




  5. #5
    NickHK
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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" <[email protected]> wrote in message
    > news:[email protected]...
    > > How about using the maxlength property.
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > > "Stuart" <[email protected]> wrote in message
    > > news:[email protected]...
    > >> 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.
    > >>
    > >>

    > >
    > >

    >
    >




  6. #6
    Stuart
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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" <[email protected]> wrote in message
    > news:[email protected]...
    >> 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" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > How about using the maxlength property.
    >> >
    >> > --
    >> > Regards,
    >> > Tom Ogilvy
    >> >
    >> >
    >> > "Stuart" <[email protected]> wrote in message
    >> > news:[email protected]...
    >> >> 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.
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >




  7. #7
    NickHK
    Guest

    Re: Userform Textbox - fundamental flaw

    Stuart,
    May be this help then.

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

    NickHK

    "Stuart" <[email protected]> wrote in message
    news:[email protected]...
    > 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" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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" <[email protected]> wrote in message
    > > news:[email protected]...
    > >> 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" <[email protected]> wrote in message
    > >> news:[email protected]...
    > >> > How about using the maxlength property.
    > >> >
    > >> > --
    > >> > Regards,
    > >> > Tom Ogilvy
    > >> >
    > >> >
    > >> > "Stuart" <[email protected]> wrote in message
    > >> > news:[email protected]...
    > >> >> 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.
    > >> >>
    > >> >>
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >

    >
    >




  8. #8
    Stuart
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > Stuart,
    > May be this help then.
    >
    > http://vbnet.mvps.org/code/textapi/txboxlines.htm
    >
    > NickHK
    >
    > "Stuart" <[email protected]> wrote in message
    > news:[email protected]...
    >> 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" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > 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" <[email protected]> wrote in message
    >> > news:[email protected]...
    >> >> 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" <[email protected]> wrote in message
    >> >> news:[email protected]...
    >> >> > How about using the maxlength property.
    >> >> >
    >> >> > --
    >> >> > Regards,
    >> >> > Tom Ogilvy
    >> >> >
    >> >> >
    >> >> > "Stuart" <[email protected]> wrote in message
    >> >> > news:[email protected]...
    >> >> >> 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.
    >> >> >>
    >> >> >>
    >> >> >
    >> >> >
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >




  9. #9
    NickHK
    Guest

    Re: Userform Textbox - fundamental flaw

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

    NickHK


    "Stuart" <[email protected]> wrote in message
    news:[email protected]...
    > 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" <[email protected]> wrote in message
    > news:[email protected]...
    > > Stuart,
    > > May be this help then.
    > >
    > > http://vbnet.mvps.org/code/textapi/txboxlines.htm
    > >
    > > NickHK
    > >
    > > "Stuart" <[email protected]> wrote in message
    > > news:[email protected]...
    > >> 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" <[email protected]> wrote in message
    > >> news:[email protected]...
    > >> > 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" <[email protected]> wrote in message
    > >> > news:[email protected]...
    > >> >> 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" <[email protected]> wrote in message
    > >> >> news:[email protected]...
    > >> >> > How about using the maxlength property.
    > >> >> >
    > >> >> > --
    > >> >> > Regards,
    > >> >> > Tom Ogilvy
    > >> >> >
    > >> >> >
    > >> >> > "Stuart" <[email protected]> wrote in message
    > >> >> > news:[email protected]...
    > >> >> >> 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.
    > >> >> >>
    > >> >> >>
    > >> >> >
    > >> >> >
    > >> >>
    > >> >>
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >

    >
    >




  10. #10
    Stuart
    Guest

    Re: Userform Textbox - fundamental flaw

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

    Regards.

    "NickHK" <[email protected]> wrote in message
    news:OV%[email protected]...
    > Stuart,
    > Sorry forgot you're in VBA.
    > How about a RichTextBox instead. It has a .HWnd property.
    >
    > NickHK
    >
    >
    > "Stuart" <[email protected]> wrote in message
    > news:[email protected]...
    >> 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" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > Stuart,
    >> > May be this help then.
    >> >
    >> > http://vbnet.mvps.org/code/textapi/txboxlines.htm
    >> >
    >> > NickHK
    >> >
    >> > "Stuart" <[email protected]> wrote in message
    >> > news:[email protected]...
    >> >> 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" <[email protected]> wrote in message
    >> >> news:[email protected]...
    >> >> > 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" <[email protected]> wrote in message
    >> >> > news:[email protected]...
    >> >> >> 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" <[email protected]> wrote in message
    >> >> >> news:[email protected]...
    >> >> >> > How about using the maxlength property.
    >> >> >> >
    >> >> >> > --
    >> >> >> > Regards,
    >> >> >> > Tom Ogilvy
    >> >> >> >
    >> >> >> >
    >> >> >> > "Stuart" <[email protected]> wrote in message
    >> >> >> > news:[email protected]...
    >> >> >> >> 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.
    >> >> >> >>
    >> >> >> >>
    >> >> >> >
    >> >> >> >
    >> >> >>
    >> >> >>
    >> >> >
    >> >> >
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >




  11. #11
    Tom Ogilvy
    Guest

    Re: 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" <[email protected]> wrote in message
    news:%[email protected]...
    > I'll give it a try, but can't see anything in Help about it.
    >
    > Regards.
    >
    > "NickHK" <[email protected]> wrote in message
    > news:OV%[email protected]...
    > > Stuart,
    > > Sorry forgot you're in VBA.
    > > How about a RichTextBox instead. It has a .HWnd property.
    > >
    > > NickHK
    > >
    > >
    > > "Stuart" <[email protected]> wrote in message
    > > news:[email protected]...
    > >> 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" <[email protected]> wrote in message
    > >> news:[email protected]...
    > >> > Stuart,
    > >> > May be this help then.
    > >> >
    > >> > http://vbnet.mvps.org/code/textapi/txboxlines.htm
    > >> >
    > >> > NickHK
    > >> >
    > >> > "Stuart" <[email protected]> wrote in message
    > >> > news:[email protected]...
    > >> >> 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" <[email protected]> wrote in message
    > >> >> news:[email protected]...
    > >> >> > 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" <[email protected]> wrote in message
    > >> >> > news:[email protected]...
    > >> >> >> 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" <[email protected]> wrote in message
    > >> >> >> news:[email protected]...
    > >> >> >> > How about using the maxlength property.
    > >> >> >> >
    > >> >> >> > --
    > >> >> >> > Regards,
    > >> >> >> > Tom Ogilvy
    > >> >> >> >
    > >> >> >> >
    > >> >> >> > "Stuart" <[email protected]> wrote in message
    > >> >> >> > news:[email protected]...
    > >> >> >> >> 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.
    > >> >> >> >>
    > >> >> >> >>
    > >> >> >> >
    > >> >> >> >
    > >> >> >>
    > >> >> >>
    > >> >> >
    > >> >> >
    > >> >>
    > >> >>
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >

    >
    >




  12. #12
    Stuart
    Guest

    Re: Userform Textbox - fundamental flaw

    Wondered about that.

    Thanks again for your help/time.

    Regards.

    "Tom Ogilvy" <[email protected]> wrote in message
    news:[email protected]...
    > 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" <[email protected]> wrote in message
    > news:%[email protected]...
    >> I'll give it a try, but can't see anything in Help about it.
    >>
    >> Regards.
    >>
    >> "NickHK" <[email protected]> wrote in message
    >> news:OV%[email protected]...
    >> > Stuart,
    >> > Sorry forgot you're in VBA.
    >> > How about a RichTextBox instead. It has a .HWnd property.
    >> >
    >> > NickHK
    >> >
    >> >
    >> > "Stuart" <[email protected]> wrote in message
    >> > news:[email protected]...
    >> >> 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" <[email protected]> wrote in message
    >> >> news:[email protected]...
    >> >> > Stuart,
    >> >> > May be this help then.
    >> >> >
    >> >> > http://vbnet.mvps.org/code/textapi/txboxlines.htm
    >> >> >
    >> >> > NickHK
    >> >> >
    >> >> > "Stuart" <[email protected]> wrote in message
    >> >> > news:[email protected]...
    >> >> >> 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" <[email protected]> wrote in message
    >> >> >> news:[email protected]...
    >> >> >> > 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" <[email protected]> wrote in message
    >> >> >> > news:[email protected]...
    >> >> >> >> 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" <[email protected]> wrote in message
    >> >> >> >> news:[email protected]...
    >> >> >> >> > How about using the maxlength property.
    >> >> >> >> >
    >> >> >> >> > --
    >> >> >> >> > Regards,
    >> >> >> >> > Tom Ogilvy
    >> >> >> >> >
    >> >> >> >> >
    >> >> >> >> > "Stuart" <[email protected]> wrote in message
    >> >> >> >> > news:[email protected]...
    >> >> >> >> >> 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.
    >> >> >> >> >>
    >> >> >> >> >>
    >> >> >> >> >
    >> >> >> >> >
    >> >> >> >>
    >> >> >> >>
    >> >> >> >
    >> >> >> >
    >> >> >>
    >> >> >>
    >> >> >
    >> >> >
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1