Solved

Resize and moving at runtime a TImage component

Posted on 1998-10-30
6
879 Views
Last Modified: 2008-02-01
How I can be able to resize and move an TImage component
or other Delphi component  (Tbutton, TStaticText) exactly
like when I use the same components at design time and move on the form.
0
Comment
Question by:mcretu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 

Author Comment

by:mcretu
ID: 1345043
Edited text of question
0
 
LVL 4

Expert Comment

by:davidmwilliams
ID: 1345044
Do you mean that you want the user to be able to click on the control and move it around the form, at run-time?
0
 

Expert Comment

by:Yoni
ID: 1345045
Well, I know how you can move any control easily but I cant help you about the resizing...
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Accepted Solution

by:
bryan7 earned 100 total points
ID: 1345046
It's very essy:
i.e: to move a button named "button1"

Button1.Left:= 25; <------ x coord
Button1.Right:= 46; <------y coord

To Resize it:

Button1.Width:=  95;
Button1.Height:=  24;

You can do this with an image too.

bryan


0
 

Author Comment

by:mcretu
ID: 1345047
Hi,
I'm so sorry but I wasn't not at all explicit in my question and this is it's my fault.
I'll put in different words my question:
I need to use an component (a component who is descendent from TImage or TButton or TPanel) which I'll be able to move and resizing at run-time with the cursor along the form.
How I can create an component from TImage who can have the methods or properties to move and resize dynamicaly at run-time ?
(I make comparasion with design-time, because when you drop several components into a
form you can move and resize with the mouse without problems).
Still for me it's a big question how I can manage these things.

0
 
LVL 3

Expert Comment

by:bryan7
ID: 1345048
hi !

why did u accept my answer then ? You should have rejected it and wait for more comments..
The only I know to move a component at run time, I think is:

Set to AUTOMATIC the drag and drop property of the component, and i.e for a button,
on the OnDragDrop event, put this code:

Button1.Left:= x;
Button1.Top:= y;

But I'm not sure,

Anyway, your question is one that I was gonna make one of these days, so I'm also
interested in knowing how to do it.
Tomorrow I'll drop your same question, so you can also have the answer.

bryan =)

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question