• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 254
  • Last Modified:

Property Sheet position in a window

Hi !!!
 
I've derived from CPropertySheet a class call CSheet, and add page derived from CPropertypage to CSheet ... (a normal Property box initialised form MFC)
 
But i want my Property Box diplayed initially  at the coordinate 0,0  and not in the middle of the screen ... How could i do this ? Please help :)
 
Thanx in advance!
0
SkizoWalker
Asked:
SkizoWalker
  • 4
  • 2
1 Solution
 
ohellCommented:
Number of ways to do this:

easiest: in OnInitDialog() of your CSheet(), call MoveWindow() with the appropriate coordinates, in your case (0, 0), which would bethe top left corner of the parent window (you have to remove the WS_CHILD attribute if you want the dialog box to go outside the creating window.). Be sure to do this AFTER the OnInitDialog() of CPropertySheet has been called.
Hope this helps
0
 
SkizoWalkerAuthor Commented:
It isn't possible to reset the position by redefining the PreCreate - CWnd - Function ?
by changing the CRect values ?
If so , how is it possible ?

0
 
SkizoWalkerAuthor Commented:
I just tried the MoveWindow command and got an undhlanded exception 0xC000005 !! Arrrgghh ...!!!
:) Please help ...

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
SkizoWalkerAuthor Commented:
Finnaly it works , i am a real lamer :)) !!

0
 
ohellCommented:
Like I said, there are a number of ways to do it...I wrote down the simplest that came to mind. But I'm curious why you were getting the exception...
0
 
SkizoWalkerAuthor Commented:
It was because the function MoveWindow takes in parameters  (LPCRECT lpRect, BOOL bRepaint = TRUE) and not a x,y Position as paramters , that' caused a stupid exception when i tried MoveWindow(50,50) :))) !!!

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now