Can STATICTEXT be multi line?



  • Hi,

    I got a STATICTEXT gadget in a GeDialog, and have to display a text with a line break.

    It is well known that GeLoadString(), which I'm using to get the string from the resource, does not support "\n" to create line breaks. The "\n" will display in the UI. Replacing "\n" with GeGetLineEnd() does hide the "\n" but does not create a line break either, when used in a STATICTEXT.

    Long story short: Is it at all possible to get a STATICTEXT to display two lines of text?

    Thanks & cheers,
    Frank



  • Update:

    String test = "First line!\nSecond line!"_s;
    

    Using this string in a STATICTEXT, does create a line break on Windows, but not on macOS... so how would it work on macOS? Of course, even on Windows it only works when the string is hard-coded, loading it with GeLoadString() does not work.



  • hello,

    I can confirm that. Now i wonder if it's a bug on windows or osx. I'm not sure if the static text was create to be able to use multiple lines.

    I've opened a Bug Entry.

    For now once solution is to use AddMultiLineEditText setting the flags to DR_MULTILINE_READONLY

    I know, not the best one by far.

    Cheers,
    Manuel



  • Thank you, that's what I suspected :-)


Log in to reply