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!
SkizoWalkerAsked:
Who is Participating?
 
ohellConnect With a Mentor Commented:
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
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.