Solved

Resize and moving at runtime a TImage component

Posted on 1998-10-30
6
874 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
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

911 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now