Board index » Visual Studio » multiline dialog text

multiline dialog text

Visual Studio162
I'm using a modeless dialog as a message box, with a simple static text

control to display the text. Like so:



pMsgWindow->SetDlgItemText(IDC_MSGWINDOW, msg); // msg is a CString



I can't get the static text box to display multiple lines... if I format

the string with "Line1 \r\n Line2" all it does is display funky

characters for the CRLF. There's no multi-line property for static text

boxes either. Any way to do this?



Thanks.


-
 

Re:multiline dialog text

Once you add the static control to your dialog, increase the height of

the static control. Only then you can see the second line and so on.



--

Cheers

Check Abdoul [VC++ MVP]

-----------------------------------



"Dave Cullen" <no_spam@mail.com>wrote in message

Quote
I'm using a modeless dialog as a message box, with a simple static text

control to display the text. Like so:



pMsgWindow->SetDlgItemText(IDC_MSGWINDOW, msg); // msg is a CString



I can't get the static text box to display multiple lines... if I format

the string with "Line1 \r\n Line2" all it does is display funky

characters for the CRLF. There's no multi-line property for static text

boxes either. Any way to do this?



Thanks.





-

Re:multiline dialog text

The control is plenty high for multiple lines. The problem is that the

text displays on only one line, with CRLF replaced with graphics

characters.



drc





CheckAbdoul wrote:

Quote


Once you add the static control to your dialog, increase the height of

the static control. Only then you can see the second line and so on.



--

Cheers

Check Abdoul [VC++ MVP]

-----------------------------------



"Dave Cullen" <no_spam@mail.com>wrote in message

news:4005B78C.BCA498AC@mail.com...

>I'm using a modeless dialog as a message box, with a simple static text

>control to display the text. Like so:

>

>pMsgWindow->SetDlgItemText(IDC_MSGWINDOW, msg); // msg is a CString

>

>I can't get the static text box to display multiple lines... if I format

>the string with "Line1 \r\n Line2" all it does is display funky

>characters for the CRLF. There's no multi-line property for static text

>boxes either. Any way to do this?

>

>Thanks.

-

Re:multiline dialog text

Quote
The control is plenty high for multiple lines. The problem is that the

text displays on only one line, with CRLF replaced with graphics

characters.



Consider a read-only multi-line edit box instead.





--

--

Jason Teagle

jason@teagster.co.uk





-

Re:multiline dialog text

try \n instead of \r\n.



Ramu Pulipati





Dave Cullen <no_spam@mail.com>wrote in message news:<4006A5C8.817D8DAC@mail.com>...

Quote
The control is plenty high for multiple lines. The problem is that the

text displays on only one line, with CRLF replaced with graphics

characters.



drc





CheckAbdoul wrote:

>

>Once you add the static control to your dialog, increase the height of

>the static control. Only then you can see the second line and so on.

>

>--

>Cheers

>Check Abdoul [VC++ MVP]

>-----------------------------------

>

>"Dave Cullen" <no_spam@mail.com>wrote in message

>news:4005B78C.BCA498AC@mail.com...

>>I'm using a modeless dialog as a message box, with a simple static text

>>control to display the text. Like so:

>>

>>pMsgWindow->SetDlgItemText(IDC_MSGWINDOW, msg); // msg is a CString

>>

>>I can't get the static text box to display multiple lines... if I format

>>the string with "Line1 \r\n Line2" all it does is display funky

>>characters for the CRLF. There's no multi-line property for static text

>>boxes either. Any way to do this?

>>

>>Thanks.

-