Skip to main content

Switch the display mode of the subeditor

To switch the display mode of the subeditor, use the SetSubEditorMode method of the IEditorPage object. The IEditorPage object can be obtained using the IWorkspaceWindow.EditorPage property. The following values ​​can be set.

Value to setCorresponding display mode
SubEditorMode.ManualManual
SubEditorMode.DetailDetails
SubEditorMode.InputInput
SubEditorMode.OutputOutput
SubEditorMode.SameAsMainSame as main
SubEditorMode.CustomCustom *1
*1

When setting a custom display mode using IEditorPage.SetSubEditorMode, if there are multiple custom display modes, the first custom display mode found will be used. If you want to specify an ID and switch to a custom display mode, see here. :::

public void ShowInSubEditor(ICommandContext c, ICommandParams p) 
{
IEditorPage editorPage = c.App.Window.EditorPage;

if (editorPage != null && !editorPage.IsSubEditorVisible)
{
c.App.Window.UI.ShowMessageBox("Please display the subeditor before executing.");
return;
}

//Switch to subeditor detail mode
editorPage.SetSubEditorMode(SubEditorMode.Detail);
}