UserControl problem

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;
}
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top