TheWizardofInt Posted January 12, 2006 Posted January 12, 2006 I am writing a program which allows adding new components - text boxes and labels I want to be able to click the edge of a text box, hold the mouse button down and drag it to increase the component's width How do I add this event to the object that I add at run time? Quote Read the Fovean Chronicles Because you just can't spend your whole day programming!
silvercoin Posted January 13, 2006 Posted January 13, 2006 :-) its just a MouseDown, MouseMove and MouseUp trick. Quote
TheWizardofInt Posted January 13, 2006 Author Posted January 13, 2006 its just a MouseDown' date=' MouseMove and MouseUp trick.[/quote'] So what is the trick? Quote Read the Fovean Chronicles Because you just can't spend your whole day programming!
Leaders snarfblam Posted January 13, 2006 Leaders Posted January 13, 2006 You record the mouse position on mouse down. You compare changes in the coordinates on mouse move and size the control accordingly. Alternatively, you record the postion on mouse down, draw a sizing rectangle on mouse move, and size the control accordingly on mouse up. Not particularly tricky. The coding part is up to you, though. If you run into any problems coding, we'll be glad to help. Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.