Application.OnComponentEnterState method (Visio)
Informs a Microsoft Visio instance that client code is causing the instance to enter or exit a particular state.
Syntax
expression.OnComponentEnterState (uStateID, bEnter)
expression A variable that represents an Application object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
uStateID | Required | VisOnComponentEnterCodes | Describes the state being entered or exited along with flags that influence behavior while in the indicated state. |
bEnter | Required | Boolean | True to indicate that a state is being entered; False to indicate that a state is being exited. |
Return value
Nothing
Remarks
The uStateID argument indicates the state being entered or exited. Code that calls this method should do so both when entering and exiting the state.
At present, the only state change supported by the OnComponentEnterState method is visComponentStateModal, indicating that the client is performing an action that causes Visio to enter or exit a modal state.
Most client code doesn't need to call the OnComponentEnterState method when causing Visio to enter or leave the state of being modal, for example, when showing modal dialog boxes. Typically, this method is used by client code that shows dialog boxes other than Microsoft Visual Basic for Applications (VBA) forms and requires behavior different from the Visio default behavior.
Following are constants and values for uStateID, which are declared by the Visio type library in VisOnComponentEnterCodes. Any of the following constants prefixed with visModal can be combined with visComponentStateModal to influence Visio behavior when transitioning to or from a modal state.
Constant | Value | Description |
---|---|---|
visComponentStateModal | 1 | The state being identified is a modal state. |
visModalDeferEvents | &H10000 | Causes Visio to attempt to defer firing events while modal. By default, Visio defers firing events when displaying its own dialog boxes, but does not defer firing events when client code has caused a dialog box to appear.In the case of several nested modal scopes, if any scope is deferring events, all scopes within the outermost scope that is deferring events will defer events.This flag only has an effect when Visio is entering a modal scope. When exiting a modal scope, Visio behaves as it did when entering the scope. |
visModalNoBeforeAfter | &H20000 | Prevents Visio from firing a BeforeModal event when entering a modal scope or an AfterModal event when leaving a modal scope.By default, Visio fires these events when displaying its own dialog boxes or displaying dialog boxes implemented by VBA, but does not fire these events when client code displays a dialog box.Calling the OnComponentEnterState method will cause these events to fire unless visModalNoBeforeAfter is specified. |
visModalDontBlockMessages | &H40000 | Prevents Visio from rejecting calls from outside its main thread while modal. By default, Visio does reject calls from outside its thread while modal.In the case of several nested modal scopes, if any scope is deferring events, all scopes within the outermost scope that is deferring events will defer events.This flag only has an effect when Visio is entering a modal scope. When exiting a modal scope, Visio behaves as it did when entering the scope. |
visModalDisableVisiosFrame | &H80000 | Causes Visio to disable its frame window while modal. By default, Visio disables its frame window when showing its own dialog boxes or when showing dialog boxes implemented by VBA, but not when client code in another process shows a dialog box.If code in another process wants to show a dialog box and have the Visio frame window behave as if it is the Visio process showing the dialog box, it can set this flag.This flag only has an effect when Visio entering a modal scope. When exiting a modal scope, Visio behaves as it did when entering the scope. |
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기