center line not working with add label
#2
I think I put enough comments in the code
Code:
#compile exe
#dim all

function pbmain() as long
  local hDlg, DialogCount as long
  dialog new 0, "SET center Line Test",,,480,300, %ws_sysmenu, 0 to hDlg

  local AA as wstring '<<--- made it wide

  ''AA= STRING$(10, 151) '<<--- 151 in UTF16 is "End of Protected Area"

  AA = string$(10, chr$$(&h2015))

  ? AA    'PRINT LINES BELOW DOES NOT '"?" in PBWin is MSGBOX
                                      '"?" for PRINT is PBCC
                                      '???? why old had line in MSGBOX ????
                                      ' maybe OEM charset

  control add label, hDlg, 203, AA , 55, 70,75,450,

  control add label, hDlg, 203, string$(10, chr$$(&h2015)) , 55, 80,75,450,

  dialog show modeless hDlg '<<--- for a top dialog to close by right click
  do                              'on task bar icon in Windows 11
    dialog doevents to DialogCount
  loop while DialogCount
end function
Try this
Code:
#compile exe
#dim all

function pbmain() as long
  local hDlg, DialogCount as long
  dialog new 0, "SET center Line Test",,,480,300, %ws_sysmenu, 0 to hDlg

  local AA as wstring

  AA = string$(10, chr$$(&h2015))

  control add label, hDlg, 203, AA , 0, 0,480,300, %ss_center or _
     %ss_centerimage or %ss_left, %ws_ex_left

  dialog show modeless hDlg
  do                             
    dialog doevents to DialogCount
  loop while DialogCount
end function 
Use the 'center' styles as needed.

I used LABEL same size as DIALOG to stay close to post 1 code.

CONTROL ADD LINE is "neater". IMO

Cheers,

((correction - character 151 (decimal) is EM_DASH in ANSI))
Reply


Messages In This Thread
RE: center line not working with add label - by Dale Yarker - 03.09.2026, 04:07

Forum Jump:


Users browsing this thread: 1 Guest(s)