I am writing an MFC Document-View application with tool bars. I want to add a tool bar at the top-right corner of the mainframe windoiw. Currently i am using below code to set the tool bar
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP | CBRS_BORDER_RIGHT
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
The above code will create the tollbar at the top left corner of the mainframe. I want to shifted it from left corner to right corner. I want the tool bar to be in top-right corner.
Options is there in MFC to set tool bar in right side,left side,top and bottom. But there is no option to set it at the top-right
Thanks in advance!
As per my knowledge , the only way to do this is by adding dummy buttons in the middle and move the button to the end.
But the only problem in this model is to adjust the button to handle Maximize option. Need to handle maximize button press and move the button gain to the right.
If there is any option please let me know. Thanks