 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Christopher Guest
|
Posted: Fri Aug 19, 2005 2:40 am Post subject: re-size of buttons |
|
|
hi
is there a way to resize a button during run-time, the same way as during
design time? Please advise
thanks
chris
|
|
| Back to top |
|
 |
Nicholas Sherlock Guest
|
Posted: Fri Aug 19, 2005 3:20 am Post subject: Re: re-size of buttons |
|
|
Christopher wrote:
| Quote: | hi
is there a way to resize a button during run-time, the same way as during
design time? Please advise
|
button1.width:=240;
button1.height:=5;
Cheers,
Nicholas Sherlock
|
|
| Back to top |
|
 |
Peter Below (TeamB) Guest
|
Posted: Fri Aug 19, 2005 9:12 am Post subject: Re: re-size of buttons |
|
|
In article <4305467c$1 (AT) newsgroups (DOT) borland.com>, Christopher wrote:
| Quote: | is there a way to resize a button during run-time, the same way as during
design time? Please advise
|
You mean with the mouse interactively, i assume. Here are a couple of links,
some of which may actually still work <g>:
TStretchHandle http://www.torry.ru/index.htm, at the Authors's
page under S for Scott, Anthony.
TControlSizer
http://community.borland.com/homepages/dsp/index.htm
http://www.simes.clara.co.uk/delphi/ctrlsize.htm
DDH by Marco Cantu has an example,
download DDh3Code.zip from
http://www.marcocantu.com/ddh/default.htm
Part II, Chapter 8 "Advanced Window Components",
DdhSizer.pas. And how to use it ..SizeCompSizeDemo.dpr.
TSizeControl http://rpi.net.au/~ajohnson/delphi/
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be
|
|
| Back to top |
|
 |
Heinrich Wolf Guest
|
Posted: Fri Aug 19, 2005 2:05 pm Post subject: Re: re-size of buttons |
|
|
Hi,
here is an example:
Keep the left Mouse Button for clicking the Button on the screen.
Use the right Mouse Button for stretching the Button on the screen.
Regards
Heiner
unit Main;
interface
uses
Windows,
Messages,
SysUtils,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
StdCtrls;
type
TMainForm = class(TForm)
MyButton : TButton;
procedure MyButtonMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure MyButtonMouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
procedure MyButtonMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormCreate(Sender: TObject);
private
StartX,
StartY,
StartHeight,
StartWidth : Integer;
end;
var
MainForm: TMainForm;
implementation
{$R *.DFM}
procedure TMainForm.MyButtonMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button = mbRight then
begin
StartX := X;
StartY := y;
StartHeight := MyButton.Height;
StartWidth := MyButton.Width;
end;
end;
procedure TMainForm.MyButtonMouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
begin
if StartX >= 0 then
begin
MyButton.Height := StartHeight + Y - StartY;
MyButton.Width := StartWidth + X - StartX;
end;
end;
procedure TMainForm.MyButtonMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
StartX := -1;
end;
procedure TMainForm.FormCreate(Sender: TObject);
begin
StartX := -1;
end;
end.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|