label alignment
Hi,
I am trying to figure out how to place a static text label in a dialog and have it centered (i.e. something like CreateLabel with width 100% but tell the control to align the text to the center).
Thanks!
Archive: label alignment
label alignment
Hi,
I am trying to figure out how to place a static text label in a dialog and have it centered (i.e. something like CreateLabel with width 100% but tell the control to align the text to the center).
Thanks!
If you are using nsDialogs, it is simple:
${NSD_CreateLabel} 0 190 100% 20 "Test"
pop $lblTest
${NSD_AddStyle} $lblTest ${SS_CENTER}
given the handle to your label control in $hwnd, use...
${NSD_AddStyle} $hwnd ${SS_CENTER}...before displaying the dialog.
For more Static Control Styles, see:"nsDialogs.nsh"
::Create 1018
>OutFile "$%temp%\temp.exe"
>var dialog
>var hwnd
>var null
>Var hUpDown
Page custom Test
>Function Test
nsDialogs
Pop $dialog
${NSD_CreateLabel} 0 0 100% 20% "This is a test$\nThis is only a test."
Pop $hwnd
${NSD_AddStyle} $hwnd ${SS_CENTER}
nsDialogs::Show
FunctionEnd
Section
SectionEnd
>
Thanks! works like a charm :-)
odd.. JohaViss's reply suddenly popped up and inserted itself in the middle.. silly forums :)
'll stick it in the the FAQ as well, gotta add that updown control thing anyway