How to multiline radio controls on dialog using MFC

Viewed 78

I have three radio options on my dialog:

enter image description here

Is it possible to turn these radio options in to multiline?

Ignore the other controls that seem to overlap because they are only visible correctly at run time.

It is just the three radio options I would like to word wrap if possible.

This is on MFC Dialog.

1 Answers

Is it possible to turn these radio options in to multiline?

Yes! If you are using the resource editor, then select the radio-button in question and, in the "Properties" pane, set the "Multiline" condition (in the "Appearance" group) to True.

If you are editing the resource script manually, then add the BS_MULTILINE style to the control.

The following screenshot is from Visual Studio 2010, but the UI is very similar in VS 2019, IIRC:

enter image description here

And here is the resource script, for the above dialog box, showing the use of the BS_MULTILINE style:

IDD_ABOUTBOX DIALOGEX 0, 0, 258, 132
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About AppWizDog"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
    ICON            IDR_MAINFRAME, IDC_STATIC, 14,14,20,20
    LTEXT           "AppWizDog, Version 1.0",IDC_STATIC, 42,14,114,8, SS_NOPREFIX
    LTEXT           "Copyright (C) 2014", IDC_STATIC, 42,26,114,8
    DEFPUSHBUTTON   "OK", IDOK, 201,111,50,14, WS_GROUP
    CONTROL         "This is a long caption text", IDC_RADIO1, "Button",
                     BS_AUTORADIOBUTTON | BS_MULTILINE, 7,52,62,22
END
Related