CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 1999
    Location
    Italy
    Posts
    80

    multiline textbox

    I've a form with textbox (multiline = true, scrollbars = vertical).
    I'm using this to show messages:


    var1= 123
    form.show
    form.text1.text= "abababab: " & var1 & chr(13) & " ananananan"



    Why the result is not a textbox with 2 lines?
    (i have "abababab: 123 'strange char' ananananan")

    Something over there is coding....
    ... and you don't know!

  2. #2
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: multiline textbox

    Try using the built in constant vbCrLf for inserting a carriage-return/line-feed character pair.


    eg.


    var1= 123
    form.show
    form.text1.text= "abababab: " & var1 & vbCrLf & " ananananan"






    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

  3. #3
    Join Date
    Nov 1999
    Location
    France
    Posts
    10

    Re: multiline textbox

    Hi,
    Use the constant VbCrLf instead of Chr(13). Or, if you really want to use the chr function, do Chr(13) & Chr(10) instead of Chr(13) alone.
    Don't forget of course to set the Multiline property of your textbox to True ;o)


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured