resizing controls on a form during runtime

reddragon

New member
Joined
Aug 10, 2004
Messages
2
Programming Experience
1-3
Hi,

I have created a form to be used by a user. On the form, the user may add one or more controls (textboxes). I would like the user to be able to resize these textboxes using the MOUSE.

I was wondering if anyone has an idea on how to do that or if it is possible?

The idea is similar to the way we are able to resize the control during our design time, which is vb.net's runtime.


Thanks!!

Any suggestions at all will be greatly appreciated...!!
 

bpl

Member
Joined
Jun 3, 2004
Messages
7
Programming Experience
10+
You should use Resize event for the control to programmatically change Width and Height property for the control.
 

Paszt

Staff member
Joined
Jun 3, 2004
Messages
1,500
Location
Raleigh, NC - USA
Programming Experience
Beginner
You will need to create a subClassed textbox containing the textBox and some resizing control(s) (maybe a small square similar to the ones in the form designer that is visible only when the mouse is over the textBox or when the user goes into resize mode by, as an example, clicking a contextMenu Item. You could use a user control as the small rectangle). Then use the small rectangles' mouseDown, mouseMove, and mouseUp events to resize the textBox.
 
Top Bottom