BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to get the position of a TEdit-component relative to scr

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
atiq
Guest





PostPosted: Thu Aug 04, 2005 9:41 am    Post subject: How to get the position of a TEdit-component relative to scr Reply with quote




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





PostPosted: Thu Aug 04, 2005 1:15 pm    Post subject: Re: How to get the position of a TEdit-component relative to Reply with quote



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





PostPosted: Thu Aug 04, 2005 1:26 pm    Post subject: Re: How to get the position of a TEdit-component relative to Reply with quote



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





PostPosted: Thu Aug 04, 2005 2:03 pm    Post subject: Re: How to get the position of a TEdit-component relative to Reply with quote

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





PostPosted: Thu Aug 04, 2005 8:08 pm    Post subject: Re: How to get the position of a TEdit-component relative to Reply with quote


"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





PostPosted: Mon Aug 08, 2005 9:35 am    Post subject: Re: How to get the position of a TEdit-component relative to Reply with quote


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





PostPosted: Mon Aug 08, 2005 9:36 am    Post subject: Re: How to get the position of a TEdit-component relative to Reply with quote


"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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.