的DocumentViewer工具栏和上下文菜单上下文、工具栏、菜单、DocumentViewer

2023-09-04 02:41:06 作者:要有多坚强才敢念念不忘

如何隐藏默认的工具栏和不允许的的DocumentViewer 控件的默认上下文菜单?

How to hide the default toolbar and to disallow the default context menu of the DocumentViewer control?

推荐答案

您可以prevent默认的上下文菜单的出现被处理的ContextMenuOpening 事件,并设置 ContextMenuEventArgs.Handled 为true。

You can prevent the default context menu from appearing by handling the ContextMenuOpening event, and setting ContextMenuEventArgs.Handled to true.

对于工具栏,我不知道 - 也许你可以以某种方式改变DocumentView的默认样式不包括工具栏?我没有做过太多的时尚潮流,不过这可能是在那里我开始寻找。

As for the toolbar, I'm not sure - maybe you could somehow change the default style of the DocumentView to not include the toolbar? I haven't ever done much with styles, but that is probably where I'd start looking.