• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 122
  • Last Modified:

Rezising objects with mouse (runtime)

How can I resize objecst (e.g. buttons, labels etc. etc.) with mouse? I can create button like this:
bu: TButton;
bu := TButton.Create(self);
bu.Parent := self
etc. etc.
and I can resize it by setting width/height, but how can I do these with mouse? I'm looking to do exactly the same thing at runtime as I can do in design mode (drag and drop objects on to form, rezise and drag them etc.).

One thing that comes to mind is that I use onMouseUp/onDrag etc. events. That way I could drag and drop objects. But how do I rezise them? I could probably do something like onClick event. If mouse is near button (but not above it) and user has pushed button and moves mouse then I would somehow resize it. This sound little complicated, doesn't it? And how do I get those 8 black things (those you see when you click button when you are in design mode) around my button? It's like a frame or something around the button?

Is there a component which would do this (freeware prefered) or how can I make it?
1 Solution
Use this to get the handles:


I think this also allows for easy resizing using the mouse events.



I know how you can move it at run time.. ( dragging with the mouse.. like in desing time ) if you are interested also
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now