Tom Juergens
2007-02-16 17:28:10 UTC
Hi,
I've written a very simple control designer with a few verbs which resize
the control it's assosciated with to a couple of default widths. When I use
the verbs to resize the control at design time the control itself is resized,
but the resize handles in the designer are not updated - they remain stuck at
the old size until I switch focus to another control and back. I can't figure
out how to get the resize handles to adjust immediately.
Can anyone help?
Thanks
Tom
To be specific:
<Designer(GetType(MyControlDesigner), GetType(IDesigner))> _
Public Class MyControl
Inherits TextBox
...
End Class
Public Class MyControlDesigner
Inherits ControlDesigner
...
Public Overrides ReadOnly Property Verbs() As DesignerVerbCollection
Get
If _verbs Is Nothing Then
_verbs = New DesignerVerbCollection()
_verbs.Add(New DesignerVerb("Maxi", New
EventHandler(AddressOf Maxi)))
_verbs.Add(New DesignerVerb("Mini", New
EventHandler(AddressOf Mini)))
End If
Return _verbs
End Get
End Property
Private Sub Maxi(ByVal sender As Object, ByVal args As EventArgs)
Me.Control.Width = 106
' Tried all sorts of things here...
End Sub
Private Sub Mini(ByVal sender As Object, ByVal args As EventArgs)
Me.Control.Width = 42
' Tried all sorts of things here...
End Sub
End Class
I've written a very simple control designer with a few verbs which resize
the control it's assosciated with to a couple of default widths. When I use
the verbs to resize the control at design time the control itself is resized,
but the resize handles in the designer are not updated - they remain stuck at
the old size until I switch focus to another control and back. I can't figure
out how to get the resize handles to adjust immediately.
Can anyone help?
Thanks
Tom
To be specific:
<Designer(GetType(MyControlDesigner), GetType(IDesigner))> _
Public Class MyControl
Inherits TextBox
...
End Class
Public Class MyControlDesigner
Inherits ControlDesigner
...
Public Overrides ReadOnly Property Verbs() As DesignerVerbCollection
Get
If _verbs Is Nothing Then
_verbs = New DesignerVerbCollection()
_verbs.Add(New DesignerVerb("Maxi", New
EventHandler(AddressOf Maxi)))
_verbs.Add(New DesignerVerb("Mini", New
EventHandler(AddressOf Mini)))
End If
Return _verbs
End Get
End Property
Private Sub Maxi(ByVal sender As Object, ByVal args As EventArgs)
Me.Control.Width = 106
' Tried all sorts of things here...
End Sub
Private Sub Mini(ByVal sender As Object, ByVal args As EventArgs)
Me.Control.Width = 42
' Tried all sorts of things here...
End Sub
End Class