Multiple line in MessageBox
-
Hello, I have a long text to print in a MessageBox so I want it on several lines. I tried something like:
MessageBox(NULL,"Test\n\rTest","",MB_OK);
but it doesn't work!! I want also the string to be loaded from a file so the 'escape sequences' will be in the string! Thanks -
Hello, I have a long text to print in a MessageBox so I want it on several lines. I tried something like:
MessageBox(NULL,"Test\n\rTest","",MB_OK);
but it doesn't work!! I want also the string to be loaded from a file so the 'escape sequences' will be in the string! ThanksIt works wonderfully for me (also, you can omit the
\r
part). Test sample follows:#include <windows.h>
int main()
{
MessageBox(NULL,"Test\nTest","",MB_OK);return 0;
}Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
-
Hello, I have a long text to print in a MessageBox so I want it on several lines. I tried something like:
MessageBox(NULL,"Test\n\rTest","",MB_OK);
but it doesn't work!! I want also the string to be loaded from a file so the 'escape sequences' will be in the string! Thanksi tried MessageBox(NULL,"Test\n\rTest","",MB_OK); on my system(win2K) and it works fine???
-
Hello, I have a long text to print in a MessageBox so I want it on several lines. I tried something like:
MessageBox(NULL,"Test\n\rTest","",MB_OK);
but it doesn't work!! I want also the string to be loaded from a file so the 'escape sequences' will be in the string! Thanks -
Hello, I have a long text to print in a MessageBox so I want it on several lines. I tried something like:
MessageBox(NULL,"Test\n\rTest","",MB_OK);
but it doesn't work!! I want also the string to be loaded from a file so the 'escape sequences' will be in the string! ThanksThanks everybody ! Sorry, in fact I did not try the MessageBox(NULL,"Test\n\rTest","",MB_OK); but loaded the string from a file !! So the \n is no more interpreted as an escape sequence but as normal text !! So I think it will not be possible to have such an escape sequence in a text file! Or do you have any suggestion ??
-
Thanks everybody ! Sorry, in fact I did not try the MessageBox(NULL,"Test\n\rTest","",MB_OK); but loaded the string from a file !! So the \n is no more interpreted as an escape sequence but as normal text !! So I think it will not be possible to have such an escape sequence in a text file! Or do you have any suggestion ??
-
This depends on the way you are "loading" your text. With a standard
fopen(filename,"r")
will throw the problem you mentioned, whereasfopen(filename,"rt")
won't. Check thefopen
for this in the MSDN. ~RaGE();Yes, thanks :) ! I'll take a look at that !!