AnchorEditor 类

提供用于配置 Anchor 属性的用户界面。

**命名空间:**System.Windows.Forms.Design
**程序集:**System.Design(在 system.design.dll 中)

语法

声明
Public NotInheritable Class AnchorEditor
    Inherits UITypeEditor
用法
Dim instance As AnchorEditor
public sealed class AnchorEditor : UITypeEditor
public ref class AnchorEditor sealed : public UITypeEditor
public final class AnchorEditor extends UITypeEditor
public final class AnchorEditor extends UITypeEditor

备注

AnchorEditor 提供了用于配置 Anchor 属性的设计时用户界面。Anchor 属性通常用于确定控件要绑定至容器的哪些端。该类提供了下拉式图形控件,该控件允许用户指定将控件锚定至容器的哪些端。

示例

下面的代码示例使用一个 EditorAttributeAnchorEditor 与属性关联。

<EditorAttribute(GetType(System.Windows.Forms.Design.AnchorEditor), GetType(System.Drawing.Design.UITypeEditor))>  _
Public Property testAnchor() As System.Windows.Forms.AnchorStyles
   Get
      Return anchor
   End Get
   Set
      anchor = value
   End Set
End Property
Private anchor As AnchorStyles
[EditorAttribute(typeof(System.Windows.Forms.Design.AnchorEditor), typeof(System.Drawing.Design.UITypeEditor))]
public System.Windows.Forms.AnchorStyles testAnchor
{
    get
    {
        return anchor;
    }
    set
    {
        anchor = value;
    }
}
private AnchorStyles anchor;       
public:
   [EditorAttribute(System::ComponentModel::Design::CollectionEditor::typeid,
      System::Drawing::Design::UITypeEditor::typeid)]
   property System::Windows::Forms::AnchorStyles testAnchor 
   {
      System::Windows::Forms::AnchorStyles get()
      {
         return anchor;
      }
      void set( System::Windows::Forms::AnchorStyles value )
      {
         anchor = value;
      }
   }
private:
   AnchorStyles anchor;
/** @attribute EditorAttribute(System.Windows.Forms.Design.AnchorEditor.
    class, System.Drawing.Design.UITypeEditor.class)
 */
/** @property 
 */
public System.Windows.Forms.AnchorStyles get_TestAnchor()
{
    return anchor;
} //get_TestAnchor

/** @property 
 */
public void set_TestAnchor(System.Windows.Forms.AnchorStyles value)
{
    anchor = value;
} //set_TestAnchor

private AnchorStyles anchor;

继承层次结构

System.Object
   System.Drawing.Design.UITypeEditor
    System.Windows.Forms.Design.AnchorEditor

线程安全

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

平台

Windows 98、Windows 2000 SP4、Windows Millennium Edition、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

请参见

参考

AnchorEditor 成员
System.Windows.Forms.Design 命名空间
Anchor