InPlaceMenu Event
Object List Next Object
Defined By: Form
Description:
Raised when an Ole Server is activated "in-place" to merge the menus of the
object (server) and container.
Usage:
Sub InPlaceMenu(WhichMenuGroup As Integer, MenuHandle As Long, SubMenuIndex As
Long, NumberOfSubMenus As Long)
Arguments Description
WhichMenuGroup (Global)
OleConstants.FILE_MENUGROUP = 0
OleConstants.CONTAINER_MENUGROUP = 2
OleConstants.MDIWINDOW_MENUGROUP = 4
MenuHandle Should be set to HMenu of container's menubar object
SubMenuIndex Set to index in menubar of requested group's first submenu
NumberOfSubMenus Set to the number of submenus in the requested group
Details:
An application's menu bar can be logically divided into the following groups:
file - open/save operations
edit - cut, paste, modify
container/object - operations specific to the application
MDI Window - manage Multiple document windows
help - access to help
When an OLE object server application in-place activates in a container
application, the user's interface reflects the activation by merging the menus of
both. Merged menus are divided into these groups:
0 containers file
- objects edit
- container specific menus
- object specific menus
- containers MDI Window
- objects help
When an OLE server becomes in-place active, the containing form will receive
three InPlaceMenu events; one for each group of the merged menu it must supply.
The WhichMenuGroup argument specifies which group is needed, for example, it
will be 0, 2, or 4 (file, container, or mdi window). These items can be referred
to by using the following constants: OleConstants.FILE_MENUGROUP = 0,
OleConstants.CONTAINER_MENUGROUP = 2, and OleConstants.MDIWINDOW_MENUGROUP = 4.
If the form has a menubar, then it should supply code for the event which:
sets the MenuHandle to HMenu of the form's menubar object
sets the SubMenuIndex to the index in the menubar of the requested group's
first submenu
sets the NumberOfSubMenus to the number of submenus present in the requested
group
Example:
Sub InPlaceMenu(WhichMenuGroup as integer, MenuHandle, SubMenuIndex,
NumberOfSubMenus as long)
If WhichMenuGroup == 0 Then
MenuHandle = MenuBar.HMenu
SubMenuIndex = 0
NumberOfSubMenus = 1
End If
If WhichMenuGroup == 2 Then
MenuHandle = MenuBar.HMenu
SubMenuIndex = 2
NumberOfSubMenus = 1
End If
End Sub
See Also:
Load event, Unload event, UnloadForm method