 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
atiq Guest
|
Posted: Thu Aug 04, 2005 9:41 am Post subject: How to get the position of a TEdit-component relative to scr |
|
|
hello to all,
how can i get the position of a component left and top relavtive to the screen ?
regards
|
|
| Back to top |
|
 |
Jeremy Darling Guest
|
Posted: Thu Aug 04, 2005 1:15 pm Post subject: Re: How to get the position of a TEdit-component relative to |
|
|
ScreenPoint := ClientToScreen(Point(Component.Top, Component.Left));
"atiq" <a.s (AT) hotmail (DOT) com> wrote
| Quote: |
hello to all,
how can i get the position of a component left and top relavtive to the
screen ?
regards
|
|
|
| Back to top |
|
 |
dd Guest
|
Posted: Thu Aug 04, 2005 1:26 pm Post subject: Re: How to get the position of a TEdit-component relative to |
|
|
atiq wrote:
| Quote: | hello to all,
how can i get the position of a component left and top relavtive to the screen ?
regards
|
var
P: TPoint;
begin
P := Point(0, 0); // P is relative to control's client area
// Note: P := Point(Edit1.Left, Edit.Top) would actually be the value
// of left and top into the control
P := Edit1.ClientToScreen(P);
ShowMessage(Format('X: %d, Y: %d', [P.X, P.Y]));
end;
|
|
| Back to top |
|
 |
Jeremy Darling Guest
|
Posted: Thu Aug 04, 2005 2:03 pm Post subject: Re: How to get the position of a TEdit-component relative to |
|
|
Oops got that backwards, it should be left, top not top, left sorry.
"Jeremy Darling" <jdarling (AT) eonclash (DOT) com> wrote
| Quote: | ScreenPoint := ClientToScreen(Point(Component.Top, Component.Left));
"atiq" <a.s (AT) hotmail (DOT) com> wrote in message
news:42f1e2d8$1 (AT) newsgroups (DOT) borland.com...
hello to all,
how can i get the position of a component left and top relavtive to the
screen ?
regards
|
|
|
| Back to top |
|
 |
Heinrich Wolf Guest
|
Posted: Thu Aug 04, 2005 8:08 pm Post subject: Re: How to get the position of a TEdit-component relative to |
|
|
"atiq" <a.s (AT) hotmail (DOT) com> schrieb im Newsbeitrag
news:42f1e2d8$1 (AT) newsgroups (DOT) borland.com...
| Quote: |
hello to all,
how can i get the position of a component left and top relavtive to the
screen ?
regards
|
Hello,
const BorderWidth = 4;
begin
x := Edit.Left
+ MainForm.Left
+ MainForm.Width - MainForm.ClientWidth - BorderWidth;
y := Edit.Top
+ MainForm.Top
+ MainForm.Height - MainForm.ClientHeight - BorderWidth;
end;
Regards
Heiner
|
|
| Back to top |
|
 |
atiq Guest
|
Posted: Mon Aug 08, 2005 9:35 am Post subject: Re: How to get the position of a TEdit-component relative to |
|
|
dd <dd (AT) bogus (DOT) com> wrote:
| Quote: | atiq wrote:
hello to all,
how can i get the position of a component left and top relavtive to the screen ?
regards
var
P: TPoint;
begin
P := Point(0, 0); // P is relative to control's client area
// Note: P := Point(Edit1.Left, Edit.Top) would actually be the value
// of left and top into the control
P := Edit1.ClientToScreen(P);
ShowMessage(Format('X: %d, Y: %d', [P.X, P.Y]));
end;
|
Hello,
it work, but i have a TGroupBox, that contain a TEdit. if i position a TForm at bottom of TEdit, the window would be position to a another position, why??
regards
|
|
| Back to top |
|
 |
atiq Guest
|
Posted: Mon Aug 08, 2005 9:36 am Post subject: Re: How to get the position of a TEdit-component relative to |
|
|
"Jeremy Darling" <jdarling (AT) eonclash (DOT) com> wrote:
| Quote: | Oops got that backwards, it should be left, top not top, left sorry.
"Jeremy Darling" <jdarling (AT) eonclash (DOT) com> wrote in message
news:42f21505$1 (AT) newsgroups (DOT) borland.com...
ScreenPoint := ClientToScreen(Point(Component.Top, Component.Left));
"atiq" <a.s (AT) hotmail (DOT) com> wrote in message
news:42f1e2d8$1 (AT) newsgroups (DOT) borland.com...
hello to all,
how can i get the position of a component left and top relavtive to the
screen ?
regards
|
Hello,
it work, but i have a TGroupBox, that contain a TEdit. if i position a TForm at bottom of TEdit, the window would be position to a another position, why??
regards
|
|
| 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
|
|