Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

Read the Fovean Chronicles

Because you just can't spend your whole day programming!

  • Leaders
Posted
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.
[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...