Underlines, SetDlgItemText, and random emulation

For all coding issues - MODers and programmers, HTML and more.

Moderators: Jeff250, fliptw

Locked
User avatar
fliptw
DBB DemiGod
DBB DemiGod
Posts: 6458
Joined: Sat Oct 24, 1998 2:01 am
Location: Calgary Alberta Canada

Underlines, SetDlgItemText, and random emulation

Post by fliptw »

watch out. code snippets

Code: Select all

//from a random header:
#define BUTTON_OK "&OK"

//inside the WM_INITDIALOG block:
SetDlgItemText(hDlg,IDC_OK,BUTTON_OK);
Doing it that way sets the text OK, but the underline under the "O" doesn't appear.

So, how do I make the underline So?
User avatar
SuperSheep
DBB Benefactor
DBB Benefactor
Posts: 935
Joined: Sun Jun 03, 2001 2:01 am
Location: Illinois

Post by SuperSheep »

Does the button work with Alt-O?

If it doesn't, then the only thing I could find dredging through the MSDN docs is SS_NOPREFIX. Make sure that isn't set for that control.

Other than that, try...

SetDlgItemText(hDlg, IDC_OK, "&Ok");

See maybe if that works, then possibly you might be changing the value of BUTTON_OK somewhere?
User avatar
fliptw
DBB DemiGod
DBB DemiGod
Posts: 6458
Joined: Sat Oct 24, 1998 2:01 am
Location: Calgary Alberta Canada

Post by fliptw »

Im a farking idiot.

I set windows not to show the underline till I hit alt.

doh.
Locked