CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2002
    Posts
    6

    newline in static text

    How do I do to simulate "enter" action in "static text" dialog ? ( use SetDlgItem can put text...But how can I put 2nd line text ?)

    Ex. I am a student.
    I like playing.
    ...............
    ...............

    Could someone give me some sample codes ? Thanks !


  2. #2
    Join Date
    May 2000
    Location
    USA,Utah
    Posts
    1,303

    Re: newline in static text


    SetDlgItemText(IDC_TEXT,"Here is first line\nHere is second line");




    Regards,
    Brandon Parker
    Regards,
    Brandon Parker

  3. #3
    Join Date
    Apr 2002
    Posts
    6

    Re: newline in static text

    Thanks a lot...

    But if I want to "dynamically" arrange text ( SetDlgItemText(xxxxx) puts "fixed" text...), what should I do ?

    Ex. 1. prepare char *p = "xxxxx\n" + "yyyyyy\n"
    + "zzzzz"
    2. SetDlgItemText( , p )

    Is this correct ???

    Thanks !!!



  4. #4
    Join Date
    Apr 2002
    Posts
    6

    Re: newline in static text

    Thanks a lot !

    But if I want to "dynamically" arrange text
    ( SetDlgItemText() puts "fixed" text), what should
    I do ?

    Ex.
    1. prepare char *p = "xxxx\n"+"yyyy\n"+"zzzz"
    2. SetDlgItemText( , p )

    Is it correct ?

    Thanks !


  5. #5
    Join Date
    Mar 2000
    Location
    Bangalore,India
    Posts
    776

    Re: newline in static text


    Hi,
    Use \r\n instead of only \n for multiline statis control
    Ex. 1. prepare char *p = "xxxxx\r\n" + "yyyyyy\r\n"
    + "zzzzz"
    2. SetDlgItemText( , p )
    Regards
    santanu


    Be sure to rate answers if it helped, to encourage them.

  6. #6
    Join Date
    Apr 2002
    Posts
    6

    Re: newline in static text

    Thanks ! I will try it immediately....


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