Vertical sizing of controls

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
 
P

pedrito

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..
 
J

John B

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
 

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

Top