Solved

Property Sheet position in a window

Posted on 1997-10-19
6
213 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!
0
Comment
Question by:SkizoWalker
  • 4
  • 2
6 Comments
 
LVL 1

Accepted Solution

by:
ohell earned 50 total points
ID: 1308420
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
 

Author Comment

by:SkizoWalker
ID: 1308421
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
 

Author Comment

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

0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:SkizoWalker
ID: 1308423
Finnaly it works , i am a real lamer :)) !!

0
 
LVL 1

Expert Comment

by:ohell
ID: 1308424
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
 

Author Comment

by:SkizoWalker
ID: 1308425
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now