& Character problem
#5
(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 Smile

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
Reply


Messages In This Thread
& Character problem - by Robert Alvarez - 30.09.2025, 08:08 PM
RE: & Character problem - by Dale Yarker - 30.09.2025, 09:00 PM
RE: & Character problem - by Robert Alvarez - 01.10.2025, 12:38 AM
RE: & Character problem - by Stuart McLachlan - 01.10.2025, 03:36 AM
RE: & Character problem - by Dale Yarker - 01.10.2025, 02:55 AM
RE: & Character problem - by Borje Hagsten - 01.10.2025, 02:29 PM
RE: & Character problem - by Stuart McLachlan - 01.10.2025, 05:09 PM
RE: & Character problem - by Dale Yarker - 01.10.2025, 03:24 PM
RE: & Character problem - by Robert Alvarez - 01.10.2025, 06:07 PM
RE: & Character problem - by Borje Hagsten - 01.10.2025, 07:21 PM
RE: & Character problem - by Robert Alvarez - 02.10.2025, 12:54 AM
RE: & Character problem - by Stuart McLachlan - 02.10.2025, 02:23 AM
RE: & Character problem - by Borje Hagsten - 02.10.2025, 02:28 AM
RE: & Character problem - by Robert Alvarez - 02.10.2025, 04:59 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)