Document directory
In vs2008, we can see that there isSplit button control, to view its effect, look at the QQ chat window "send", "message record" the two buttonsI know. Actually, there is something like combo box. But its implementation should be button plus menu. So its message processing can be split into button processing and menu processing.
Drag a split button to the dialog and bind it with a variable.
Csplitbutton m_sbsend;
Ddx_control (PDX, idc_split1, m_sbsend );
Because the split button is actually a combination of Button and menu, you have to make the entire menu first. It is not a special menu, it is also a commonly used menu on the home page.
M_split.Setdropdownmenu(Idr_menu1, 0); // Add the split button drop-down menu. the first parameter is the resource ID of the menu, and the second parameter is the sub-item index, that is, the menu root item is counted from the left to the right. we can only use one of its sub-menus here.
Message Processing
Message Processing and general buttons in the button section of the split buttonSame.
On_bn_clicked (idc_split1, onbnclickedsplit1)
Void cmfccontroldlg: onbnclickedsplit1 ()
{
Afxmessagebox (_ T ("Click split button "));
}
Processing of the drop-down menu
The processing of the drop-down menu in the split button is similar to that of the general menu.
On_command (id_split_menu1, sendmsg)
Void cmfccontroldlg: sendmsg ()
{
Afxmessagebox (_ T ("Click dropdown menu of split button "));
}