D
Dave Johnson
I'm trying to create a UserControl that contains a combo box, a text box
and
a check box. The one that is displayed depends on the value of a
property.
All three of those controls have their DockStyle set to Fill. Here's the
problem, the UserControl isn't moveable at design time. I can drop it on
a
form, and I can move it if I change the Location property. However, I
can't
drag it to a new location. Any suggestions?
I do have a custom designer for it which overrides the SelectionRules
property like this:
public override SelectionRules SelectionRules {
get {
if( this.controlType == ControlType.CheckBox ) {
return
SelectionRules.AllSizeable |
SelectionRules.Visible |
SelectionRules.Moveable;
} else {
return
SelectionRules.LeftSizeable |
SelectionRules.RightSizeable |
SelectionRules.Visible |
SelectionRules.Moveable;
}
}
}
and
a check box. The one that is displayed depends on the value of a
property.
All three of those controls have their DockStyle set to Fill. Here's the
problem, the UserControl isn't moveable at design time. I can drop it on
a
form, and I can move it if I change the Location property. However, I
can't
drag it to a new location. Any suggestions?
I do have a custom designer for it which overrides the SelectionRules
property like this:
public override SelectionRules SelectionRules {
get {
if( this.controlType == ControlType.CheckBox ) {
return
SelectionRules.AllSizeable |
SelectionRules.Visible |
SelectionRules.Moveable;
} else {
return
SelectionRules.LeftSizeable |
SelectionRules.RightSizeable |
SelectionRules.Visible |
SelectionRules.Moveable;
}
}
}