![]() |
|
center line not working with add label - Printable Version +- PowerBASIC Users Meeting Point (http://pump.richheimer.de) +-- Forum: User to User Discussions (http://pump.richheimer.de/forumdisplay.php?fid=3) +--- Forum: PowerBASIC for Windows (http://pump.richheimer.de/forumdisplay.php?fid=4) +--- Thread: center line not working with add label (/showthread.php?tid=134) |
center line not working with add label - Robert Alvarez - 02.09.2026 #COMPILE EXE FUNCTION PBMAIN() AS LONG LOCAL hDlg AS LONG DIALOG NEW 0, "SET center Line Test",,,480,300, %WS_SYSMENU, 0 TO hDlg LOCAL AA AS STRING AA= STRING$(10, 151) ? AA 'PRINT LINES BELOW DOES NOT CONTROL ADD LABEL, hDlg, 203,AA , 55, 70,75,450, CONTROL ADD LABEL, hDlg, 203,STRING$(10, 151) , 55, 80,75,450, DIALOG SHOW MODAL hDlg END FUNCTION RE: center line not working with add label - Dale Yarker - 03.09.2026 I think I put enough comments in the code Code: #compile exeCode: #compile exeI 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)) RE: center line not working with add label - Jules Marchildon - 04.09.2026 If the goal is to draw a horizontal center line, using repeated em dashes is really relying on a text character as a graphics primitive. That's inherently font-dependent. DDT controls use a default windows font unless you explicitly specify one. If that particular font, font substitution or the way the ANSI character is converted doesn't handle character 151 as expected, you could get an incorrect character or potentially something that looks like a different line... Like Dale said, it's better to draw your own line. RE: center line not working with add label - Dale Yarker - 04.09.2026 Thankyou Jules, Your post maked me realize that I didn't stress using AS WSTRING, and AS WSTRINGZ strongly enough, even for plain text. (CONTROL ADD LINE is probably better in most cases and can also do vertical lines) |