I would just use chr(10,10, . . .) to pull the text down.
Code: Select all
#include "windows.bi"
Function Set_Font (Font As String,Size As long,Bold As long,Italic As long,Underline As long,StrikeThru As long) As HFONT
Dim As HDC hDC=GetDC(HWND_DESKTOP)
Dim As long CyPixels=GetDeviceCaps(hDC,LOGPIXELSY)
ReleaseDC(HWND_DESKTOP,hDC)
Return CreateFont(0-(Size*CyPixels)/72,0,0,0,Bold,Italic,Underline,StrikeThru,ANSI_CHARSET _
,OUT_TT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FF_DONTCARE,Font)
End Function
Dim As HFONT ThisFont=Set_Font("Times new roman",34,0,0,0,0)
Dim As HFONT smallFont=Set_Font("Times new roman",8,0,0,0,0)
var mainwindow=CreateWindowEx(0,"#32770","Main.",WS_OVERLAPPEDWINDOW or WS_VISIBLE,200,200,800,600,0,0,0,0)
var stat=createwindowex(0,"static",chr(10,10)+"Sunk a bit on bottom." , WS_CHILD or WS_VISIBLE or SS_SUNKEN or SS_RIGHT ,10,0,270,50,MainWindow,0,0,0)
var stat2=createwindowex(0,"static",chr(10,10)+"With a border on bottom" , WS_CHILD or WS_VISIBLE or WS_BORDER or SS_LEFT ,10,80,370,50,MainWindow,0,0,0)
var stat3=createwindowex(0,"static",chr(10,10)+"With a border in centre" , WS_CHILD or WS_VISIBLE or WS_BORDER or SS_CENTER ,10,160,370,50,MainWindow,0,0,0)
var stat4=createwindowex(0,"static",chr(10,10)+"With a border" , WS_CHILD or WS_VISIBLE or SS_CENTER or WS_BORDER,10,240,760,150,MainWindow,0,0,0)
var stat5=createwindowex(0,"static","https://docs.microsoft.com/en-us/windows/win32/controls/static-control-styles" , WS_CHILD or WS_VISIBLE or SS_CENTER ,10,400,760,150,MainWindow,0,0,0)
SendMessage(stat4,WM_SETFONT,Cast(WPARAM,ThisFont),0)
SendMessage(stat5,WM_SETFONT,Cast(WPARAM,SmallFont),0)
dim as MSG emsg
While GetMessage( @emsg, 0, 0, 0 )
'TranslateMessage( @emsg )
DispatchMessage( @emsg )
Select Case emsg.hwnd
Case mainwindow
Select Case emsg.message
Case 273 : PostQuitMessage(0)
End Select
End Select
wend
I don't understand your op.
label.style = current_style or SS_LEFT or SS_CENTERIMAGE ' // for left-center align
...
...
Is it a library thing or a custom udt.