nepaluz
asked on
Unstable designer when I include a ToolStripCheckbox Class
Hello.
I want to add a CheckBox to a toolstrip and havebeen able to do this with the class below. I added the line
I want to add a CheckBox to a toolstrip and havebeen able to do this with the class below. I added the line
<ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.ToolStrip)> _
to have the CheckBox available in the designer, and this works. However, the designer is "unstable". I donot not know howelse to describe this, but, after adding the class below to the project, buttons already added to the project "at times" go missing from the designer or are in-accessible from the designer unless selected from the properties window. Infact, any further additions to the designer after compiling (and moving away from the designer then back) do not seem to "stick". Any ideas what is happening or on how toimplement this differently? I'd prefer to have the checkbox available in the designer. Here's is my entire class that is causing these issues.Imports System.Windows.Forms.Design
<ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.ToolStrip)> _
Public Class ToolStripCheckBox
Inherits ToolStripControlHost
Public Sub New()
MyBase.New(New CheckBox)
End Sub
Public ReadOnly Property CheckBoxControl As CheckBox
Get
Return TryCast(Control, CheckBox)
End Get
End Property
Public Property Checked As Boolean
Get
Return CheckBoxControl.Checked
End Get
Set(ByVal value As Boolean)
CheckBoxControl.Checked = value
End Set
End Property
End Class
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER