|
-
May 6th, 1999, 07:29 AM
#1
Property sheets moving buttons, Why this don't works ?
Hi,
I have one property sheet wit only one button ( Ok button), and I want to move it to the right ( put it in the help button position), I have make a little test with this:
CRect rectBtn;
pOkButton->GetWindowRect(rectBtn);
rectBtn.left = rectBtn.left+5;
rectBtn.right = rectBtn.right+5;
pOkButton->MoveWindow(rectBtn);
But then when the property sheet is shown, the button is not shown !, What have I made wrong ? Is another way to do it easier ?
Thanks, Bye !
Braulio
-
May 6th, 1999, 08:44 AM
#2
Re: Property sheets moving buttons, Why this don't works ?
GetWindowRect returns screen coordinates.
MoveWindow expects coordinates relative to the parent window.
You are actually moving the button off the property sheet.
After calling GetWindowRect, call ScreenToClient.. like this:CRect rectBtn;
pOkButton->GetWindowRect(rectBtn);
ScreenToClient(&rectBtn);
rectBtn.left = rectBtn.left+5;
rectBtn.right = rectBtn.right+5;
pOkButton->MoveWindow(rectBtn);
Rgds,
Brian
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|