M
Mike
I created my own toolstrip control using ToolStripControlHost. When I
add this to a toolstrip, I want to adjust the properties of the hosted
control in the designer but they always get reset when I compile. Can
anyone tell me how to fix this? This should be similar to accessing
the panels in a SplitContainer control so I think it is possible.
Here is some *sample* code to illustrate the problem.
[ToolStripItemDesignerAvailability
(ToolStripItemDesignerAvailability.ToolStrip |
ToolStripItemDesignerAvailability.StatusStrip)]
public class ToolStripHostExample : ToolStripControlHost
{
public TextBox MyControl
{
get { return (TextBox)Control; }
}
public ToolStripHostExample() : base(new TextBox())
{
}
}
Add it to a toolstrip and try to set the MyControl.ReadOnly attribute
to true in the designer. When you compile, the property will be reset
to false.
add this to a toolstrip, I want to adjust the properties of the hosted
control in the designer but they always get reset when I compile. Can
anyone tell me how to fix this? This should be similar to accessing
the panels in a SplitContainer control so I think it is possible.
Here is some *sample* code to illustrate the problem.
[ToolStripItemDesignerAvailability
(ToolStripItemDesignerAvailability.ToolStrip |
ToolStripItemDesignerAvailability.StatusStrip)]
public class ToolStripHostExample : ToolStripControlHost
{
public TextBox MyControl
{
get { return (TextBox)Control; }
}
public ToolStripHostExample() : base(new TextBox())
{
}
}
Add it to a toolstrip and try to set the MyControl.ReadOnly attribute
to true in the designer. When you compile, the property will be reset
to false.