I have a simple problem with my static text control. I want to write two sentences in two lines.
I searched everywhere, they answered that its style should not be simple and it should be big enough and then it can be done with \n or \r\n. Another guy wrote that it worked!
I did that, but it's not working! The caption is "Welcome to Genetic Algorithm Simulator Application.\nPlease Choose a Function:" but it just ignores \n and shows this: Welcome to Genetic Algorithm Simulator Application.Please Choose a Function:"
Also keep in mind that if the "Center Image" style (SS_CENTERIMAGE) is applied (giving you vertical centering of the text), then "\r\n" character sequences are ignored.
You should not set SS_SIMPLE style for static control. This is what is causing control to display only single line ignoring new line character. Get rid of this style and it will work.
I tried it with MFC in VS2008, in the static text control properties set the property "No Wrap" to False and the text should be automatically wrapped to the size of the control.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With