We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Property Sheet position in a window

SkizoWalker
SkizoWalker asked
on
Medium Priority
266 Views
Last Modified: 2013-11-20
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!
Comment
Watch Question

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

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

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 ?

Author

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

Author

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

Commented:
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...

Author

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) :))) !!!

Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.