Solved

Resize and moving at runtime a TImage component

Posted on 1998-10-30
6
877 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

830 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