Window size

The RibbonBar and QuickAccessToolbar are bound to and contained inside the MDI frame window (this is different from the tab bar which is contained inside the MDI client area).

If the MDI/MDIHelp frame window does not adjust the size of the MDIClient area through the resize event, the system will automatically adjust the size of the MDIClient area to ensure that the RibbonBar control is displayed in the appropriate position (without the user having to add or modify code).

However, if the MDI/MDIHelp frame window resizes the MDIClient area through the resize event, you need to consider the size of the RibbonBar control in the resize event.

For example, you can add the following code to the resize event:

mdi_1.x = this.workspacex ()
mdi_1.y = this.workspacey() + this.mdirbb_1.getbestheight()
mdi_1.height = this.workspaceheight() - this.mdirbb_1.getbestheight()
mdi_1.width = this.workspacewidth()

Note: Use the GetBestHeight method instead of the height property to get the height of the RibbonBar, because if the user turns on the AutosizeHeight property of the RibbonBar (turned on by default), using the height property directly may not accurately get the height (for example, when the QuickAccessToolbar feature is dynamically enabled, the height property may not include the height of the QuickAccessToolbar).

In addition, if the current application MDI/MDIHelp frame Window has customized the size of the MDIClient area (that is, if the size of the MDIClient area is not the default value), which may cause the RibbonBar control area to be displayed but actually occupied by the MDIClient area, resulting in no response when the mouse clicks on the area. The solution is to adjust the size of the MDIClient area to ensure that the RibbonBar control has enough space for display and operation. You can refer to the code example mentioned above and adjust the position and size of the MDIClient area as needed to meet the display and operation requirements of the RibbonBar.