Vertical sizing of controls

  • Thread starter Thread starter John B
  • Start date Start date
J

John B

Hi all,
I want to prevent the user being able to vertically size a control, in
the same manner that single line textbox and autosize labels do.
I can override SetBoundsCore which prevents the actual sizing but the
vertical resize grips still show for the user, even though they have no
effect.

Any ideas appreciated.

JB
 
John B said:
Hi all,
I want to prevent the user being able to vertically size a control, in the
same manner that single line textbox and autosize labels do.
I can override SetBoundsCore which prevents the actual sizing but the
vertical resize grips still show for the user, even though they have no
effect.

Any ideas appreciated.

JB

John,

The TextBox does this (actually TextBoxBase does this) by using a custom
ControlDesigner derived class that overrides the SelectionRules property.
You can do the same. It's really not that difficult. If you do a google
search on ControlDesigner, I'm sure you'll find several tutorials around (I
think CodeProject has some) on how to create and use ControlDesigners..
 
pedrito said:
John,

The TextBox does this (actually TextBoxBase does this) by using a custom
ControlDesigner derived class that overrides the SelectionRules property.
You can do the same. It's really not that difficult. If you do a google
search on ControlDesigner, I'm sure you'll find several tutorials around (I
think CodeProject has some) on how to create and use ControlDesigners..
Excellent

Thanks pedrito.

JB
 
Back
Top