01.10.2025, 03:36 AM
(This post was last modified: 01.10.2025, 04:01 AM by Stuart McLachlan.)
(01.10.2025, 12:38 AM)Robert Alvarez Wrote: FORMATTING NOT SHOWING CORRECT ON POST
type A&B
screen show AB <-- SHOULD BE B UNDERLINE
xprint show A&B
doing xprint better to print to file than waste paper
Known behaviour of recent versions of Windows.
By default, you need to hit Alt key to show keyboard shortcuts in menus and labels (and button text).
"&&" shows the character "&" in such controls and it is NOT a shortcut.
To demonstrate more clearly, try "&DONE" as the button label

Demonstration of what is actually stored:
Code:
#COMPILE EXE
#DIM ALL
%UNICODE = 1
GLOBAL hDlg AS DWORD, A AS STRING
CALLBACK FUNCTION DisplayIt
LOCAL s AS STRING
CONTROL GET TEXT CB.HNDL, 1002 TO s
? s & $LF & A
END FUNCTION
CALLBACK FUNCTION TEXTT()
CONTROL GET TEXT hDlg, 1000 TO A
CONTROL SET TEXT hDlg, 1002, A
END FUNCTION
FUNCTION PBMAIN () AS LONG
LOCAL W, RtoL AS WSTRING
LOCAL R AS STRING
W = CHR$$(&h1D08)
RtoL = CHR$$(&h21D0) 'F4)
DIALOG DEFAULT FONT "Consolas", 10, 0, 1
DIALOG NEW 0, W, , , 150, 50, %WS_OVERLAPPEDWINDOW, %WS_EX_LEFT OR _
%WS_EX_LTRREADING TO hDlg
CONTROL ADD TEXTBOX, hDlg, 1000, "", 5, 5, 40, 12
CONTROL ADD BUTTON ,hDlg,1001, "&DONE", 50,5,40,12, CALL TEXTT
CONTROL ADD LABEL ,hDlg,1002, "XX", 50,25,40,12, '
CONTROL ADD BUTTON ,hDlg,1003, "Display", 100, 5,40,12, CALL Displayit
DIALOG SHOW MODAL hDlg
END FUNCTION
You can control this behaviour with:
Control Panel > Ease of Access Center > Make the keyboard easier to use > Enable "Underline keyboard shortcuts and access keys".
--
New PowerBASIC User Community Forum:
https://pbusers.org/forum
New PowerBASIC User Community Forum:
https://pbusers.org/forum