Solved

Resize and moving at runtime a TImage component

Posted on 1998-10-30
6
873 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

14 Experts available now in Live!

Get 1:1 Help Now