Skip to content
⌘ NSIS Forum Archive

Label with long contents not displayed in multi-line- MU1

6 posts

DivyaArun#

Label with long contents not displayed in multi-line- MU1

Hi,

I have a label with contents set at run-time and the contents is too long , hence needs to be displayed as multi-line. Labels automatically word-wrap, but in my case, the contents gets cropped if it exceeds the width of the label.

The same when statically set in NSISDialogDesigner shows the contents as multi-line.

Please help!!

Thanks,
Divya
Anders#
MUI page (welcome/finish) or a custom page?

Please post some minimal code that recreates the issue.
DivyaArun#
Originally Posted by Anders View Post
MUI page (welcome/finish) or a custom page?

Please post some minimal code that recreates the issue.
It's a custom page. Nothing complicated I have done

Function serverConfigPage
!insertmacro MUI_HEADER_TEXT "Confirm Settings" ""

nsDialogs::Create 1018
Pop $serverConfigDialog

${If} $serverConfigDialog == error
Abort
${EndIf}

; === Label6 (type: Label) ===
${NSD_CreateLabel} 89.52u 68.46u 50% 55.38u "$INSTDIR"

nsDialogs::Show

FunctionEnd
Anders#
Floating point numbers are not actually supported but everything else looks OK. You could inspect the control with WinSpy++ to make sure it has the expected size.
DivyaArun#
Originally Posted by Anders View Post
Floating point numbers are not actually supported but everything else looks OK. You could inspect the control with WinSpy++ to make sure it has the expected size.
Hi,

I was able to find the cause of the issue. I was trying to display my appdata folder in the label, which is a long string without any space EX: C:\Users\....\AppData\Local\.....
When I added space after each '\', the string was displayed in multiple lines.

Thanks
Anders#
The style of a label can be modified so that it displays "c:\users\....\lastfolder\file" if the string is too long.

Another alternative is to use a read-only editbox without borders, Explorer does that in some places where it needs to display a path.