'参照設定に System.Design.dll が必要。
Imports System.Windows.Forms.Design
Imports System.ComponentModel
<Designer(GetType(MyTextBoxDesigner))> _
Public Class MyTextBox
Inherits TextBox
Protected Overrides ReadOnly Property DefaultSize() As System.Drawing.Size
Get
Return New Size(120, 19)
End Get
End Property
Public Overloads Property Size() As Size
Get
Return MyBase.Size
End Get
Set(ByVal value As Size)
End Set
End Property
End Class
Friend Class MyTextBoxDesigner
Inherits ControlDesigner
Public Overrides ReadOnly Property SelectionRules() As System.Windows.Forms.Design.SelectionRules
Get
Return MyBase.SelectionRules And Not SelectionRules.AllSizeable
End Get
End Property
End Class
J+WPgueFp+ioreWumuOBqyBTeXN0ZW0uRGVzaWduLmRsbCDjgYzlv4XopoHjgIIKSW1wb3J0cyBTeXN0ZW0uV2luZG93cy5Gb3Jtcy5EZXNpZ24KSW1wb3J0cyBTeXN0ZW0uQ29tcG9uZW50TW9kZWwKCjxEZXNpZ25lcihHZXRUeXBlKE15VGV4dEJveERlc2lnbmVyKSk+IF8KUHVibGljIENsYXNzIE15VGV4dEJveAogICAgSW5oZXJpdHMgVGV4dEJveAoKICAgIFByb3RlY3RlZCBPdmVycmlkZXMgUmVhZE9ubHkgUHJvcGVydHkgRGVmYXVsdFNpemUoKSBBcyBTeXN0ZW0uRHJhd2luZy5TaXplCiAgICAgICAgR2V0CiAgICAgICAgICAgIFJldHVybiBOZXcgU2l6ZSgxMjAsIDE5KQogICAgICAgIEVuZCBHZXQKICAgIEVuZCBQcm9wZXJ0eQoKICAgIFB1YmxpYyBPdmVybG9hZHMgUHJvcGVydHkgU2l6ZSgpIEFzIFNpemUKICAgICAgICBHZXQKICAgICAgICAgICAgUmV0dXJuIE15QmFzZS5TaXplCiAgICAgICAgRW5kIEdldAogICAgICAgIFNldChCeVZhbCB2YWx1ZSBBcyBTaXplKQogICAgICAgIEVuZCBTZXQKICAgIEVuZCBQcm9wZXJ0eQoKRW5kIENsYXNzCgpGcmllbmQgQ2xhc3MgTXlUZXh0Qm94RGV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