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!
label alignment
5 posts
If you are using nsDialogs, it is simple:
Look here for more styles:
Regards,
Johan
${NSD_CreateLabel} 0 190 100% 20 "Test"
pop $lblTest
${NSD_AddStyle} $lblTest ${SS_CENTER}Look here for more styles:
Regards,
Johan
given the handle to your label control in $hwnd, use...
Example:
${NSD_AddStyle} $hwnd ${SS_CENTER} ...before displaying the dialog.Example:
!include "nsDialogs.nsh"
OutFile "$%temp%\temp.exe"
var dialog
var hwnd
var null
Var hUpDown
Page custom Test
Function Test
nsDialogs::Create 1018
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 For more Static Control Styles, see: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
'll stick it in the the FAQ as well, gotta add that updown control thing anyway