Form.IsRestrictedWindow Form.IsRestrictedWindow Form.IsRestrictedWindow Form.IsRestrictedWindow Property


获取一个值,该值指示窗体是否可以不受限制地使用所有窗口和用户输入事件。Gets a value indicating whether the form can use all windows and user input events without restriction.

 property bool IsRestrictedWindow { bool get(); };
public bool IsRestrictedWindow { get; }
member this.IsRestrictedWindow : bool
Public ReadOnly Property IsRestrictedWindow As Boolean


如果窗体有限制,则为 true;否则为 falsetrue if the form has restrictions; otherwise, false. 默认值为 trueThe default is true.


IsRestrictedWindow属性确定是否AllWindows授予权限。The IsRestrictedWindow property determines whether the AllWindows permission is granted. 此属性在窗体的构造函数中的运行时设置,并在窗体的生存期内缓存。This property is set at run time in the form's constructor, and is cached for the lifetime of the form. 在部分信任环境中运行的 Windows 窗体应用程序不能绕过此检查,因为公共语言运行时可确保,在部分信任情况下始终调用父构造函数。Windows Forms applications running in partial trust cannot circumvent this check, as the common language runtime ensures that the parent constructor is always called in partial trust.