「スニペット/UserControlSnapLines」の編集履歴(バックアップ)一覧に戻る

スニペット/UserControlSnapLines - (2007/06/27 (水) 14:43:49) の編集履歴(バックアップ)


このスニペットについて

ユーザーコントロールにスナップラインを追加します。

サンプル

Imports System.Windows.Forms.Design.Behavior

<System.ComponentModel.Designer(GetType(UserControlDesigner))> _
Public Class UserControl1
    Public Sub a()
    End Sub
End Class

'ユーザーコントロールクラスの属性に
'<System.ComponentModel.Designer(GetType(UserControlDesigner))>
'を追加する必要があります。
Public Class UserControlDesigner
    Inherits System.Windows.Forms.Design.ControlDesigner
    Public Overrides ReadOnly Property SnapLines() As System.Collections.IList
        Get
            Dim lines As System.Collections.ArrayList = MyBase.SnapLines
            lines.Add(New SnapLine(SnapLineType.Baseline, 14, SnapLinePriority.Medium))
            Return lines
        End Get
    End Property
End Class