Share via


DesignTimeVisibleAttribute 类

DesignTimeVisibleAttribute 标记组件的可见性。如果存在 Yes,可视化设计器即可在设计器上显示该组件。

**命名空间:**System.ComponentModel
**程序集:**System(在 system.dll 中)

语法

声明
<AttributeUsageAttribute(AttributeTargets.Class Or AttributeTargets.Interface)> _
Public NotInheritable Class DesignTimeVisibleAttribute
    Inherits Attribute
用法
Dim instance As DesignTimeVisibleAttribute
[AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Interface)] 
public sealed class DesignTimeVisibleAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Class|AttributeTargets::Interface)] 
public ref class DesignTimeVisibleAttribute sealed : public Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Interface) */ 
public final class DesignTimeVisibleAttribute extends Attribute
AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Interface) 
public final class DesignTimeVisibleAttribute extends Attribute

备注

DesignTimeVisibleAttribute 是提供给设计器的提示。对于具有 UI 的组件,设计器将忽略此属性。它仅应用于类。

如果有接受子组件的控件,则 DesignTimeVisibleAttribute 非常有用。例如,System.Windows.Forms.TreeView 控件的节点项不应显示在组件栏中,这是因为节点项是由 System.Windows.Forms.TreeView 控件绘制的。

继承层次结构

System.Object
   System.Attribute
    System.ComponentModel.DesignTimeVisibleAttribute

线程安全

此类型的任何公共静态(Visual Basic 中的 Shared)成员都是线程安全的,但不保证所有实例成员都是线程安全的。

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

.NET Compact Framework

受以下版本支持:2.0

请参见

参考

DesignTimeVisibleAttribute 成员
System.ComponentModel 命名空间