Results 1 to 15 of 15
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CR/LF in Control Tip text (all)

    I'm stumped.

    I pasted text paragraphs from my systems documentation directly into the ControlTip text for each control. The GUI form shows up with screen-wide tips that read like this:

    "The name within Access of the table of USER Identifiers. You can experiment with different tables merely by changing this entry."

    Ahhah! I said, If I replace each period (in the text) with a vbCRLF, I'll get a control tip that looks like a paragraph, instead of a 1200-pixel wide ticker-tape.

    Hence the code below.


    <pre>Public Function FormatControlTips()
    ' Prepare CR/LF for each control tip text.

    Dim ctl As Control
    For Each ctl In Me.Controls
    ctl.ControlTipText = strReplaceAll(ctl.ControlTipText, ".", "." & vbNewLine)
    Next ctl
    End Function
    </pre>


    Trouble is, the vbNewLine (same if I use vbCrLf) show up as two lozenges after each period, but there's no CR/LF effect; I still see one long line of text.

    Any clues? (yes, I know, "Any tips?". Hah hah)

    I've experimented with all four combinations of AutoSize and WordWrap.

    The clues posted in the {serach} above suggest it can't be done. I couldn't get Charlotte's Shift-Enter to work,

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CR/LF in Control Tip text (all)

    Aren't you asking the same question raised in the post to which you refer? How to get multi-line control tips?

    My investigations ended in quiet disappointment.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CR/LF in Control Tip text (all)

    Yeh, I've found this to be true too. Try using chr(10) instead of vbcrlf . I get the same little squares when I write to a cell so maybe this will also work in controltips (I haven't tried it there).

    <pre>activecell = "my name is " & chr(10) & "Woody"
    </pre>


    Deb

  4. #4
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CR/LF in Control Tip text (all)

    > Aren't you asking the same question

    Yabbut: .....

    1) I compose the questions off-line and don't get to see the result of the search until after I've posted (yeah, I know, Preview, but if things screw up I lose my post ...)

    2) I figured that maybe someone else would be around who knew more than you did (grin)

    3) Sheesh, Kev; I gave you enough time to come up with a brilliant solution. I was doing you a favour by giving you an opportunity to shine ......



    Please see also my reply to jujuraf

  5. #5
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CR/LF in Control Tip text (all)

    Nice try, but no LineFeed. Thanks anyway. I tried chr$(10) to give it a fighting chance ....

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: CR/LF in Control Tip text (all)

    I take it this is something you simply *must* do in code and you're trying to replicate the effect of Ctrl+Enter from the keyboard? Try vbCr. That works if you just assign the string directly to a control's controltiptext property so it should work in your replace routine.

    ctl.ControlTipText = strReplaceAll(ctl.ControlTipText, ".", "." & vbCr)

    This definitely works:

    Me.CompanyName.ControlTipText = "Common name" & vbCr & "for this company"
    Charlotte

  7. #7
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CR/LF in Control Tip text (all)

    > This definitely works:

    Charlotte, thanks for the response.

    Neither technique worked in my Win98/Word97SR2 VBA.

    I ought to try it in Acess97 and then switch to the WinXP/OfficeXP system, I suppose.

    Yes, I would like to do it via code. I set GUI form colours, fonts etc by code so that the screens have a consistent look throughout the application. I'd like to be able to have my ControlTip text duplicate the system documentation - pasting text from a good user doc is a time-saver.

  8. #8
    JustCallMeAl
    Guest

    Re: CR/LF in Control Tip text (all)

    In Word97 SR2, Windows 98, it looks like the controltext property will only accept chr(32) to chr(255)

    In Word 2000+, which uses VBA version 6, it may work differently.

  9. #9
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CR/LF in Control Tip text (all)

    I was hoping I could achieve fame and glory by discovering the means whereby Word 97 control tips could display on multiple lines. That pot of gold sits there still.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  10. #10
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CR/LF in Control Tip text (all)

    Nope. Couldn't get any reasonable combonation (Chr$(13), vbCRLF, vbNewLine ) to work in my WinXp/OfficeXP sample copy. I realise that i got my stuff sort of pre-release at a trade-show hosted by MSoft, but if it had been changed, I'd have thought it would've been in there.

    I gather from BigAl's comment that he hasn't TRIED it in 2000, and from Kevin's that he's had no breakthrough either.

  11. #11
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: CR/LF in Control Tip text (all)

    I can't tell you it works in Word 2000 because I avoid even thinking about creating forms in Word, but using vbCr (not, please note, vbCrLf, which doesn't work) definitely does work in VB6/Access 2000 using the code I posted.
    Charlotte

  12. #12
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: CR/LF in Control Tip text (all)

    Chris,
    It does not work in Word 2000 - I tried all combinations I could think of including passing the string to the Tag property (which works fine with multiple lines) and then setting the ControlTipText equal to the Tag but to no avail.
    Regards,
    Rory

    Microsoft MVP - Excel

  13. #13
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CR/LF in Control Tip text (all)

    Rory, thanks for this confirmation. Looks like Harold really has filtered out all the non-keyboard characters. Another case of a rule being made purely for the sake of having a rule.

  14. #14
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: CR/LF in Control Tip text (all)

    It's particularly annoying as it works elsewhere!
    Regards,
    Rory

    Microsoft MVP - Excel

  15. #15
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: CR/LF in Control Tip text (all)

    Has anyone tried an API call to set TTM_SETMAXTIPWIDTH. See <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Cat=&Board=wrd&Number=78091&page=& view=&sb=&o=&vc=1#Post78091>this thread.</A>
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

Posting Permissions

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