Window sizing problem in CFormView app
-
Hi, I have a CFormView-based application in which I am having a weird window sizing problem. On startup, my view window is very large vertically. It is so large that I can't see the top or the bottom of the window - it is completely off the screen. In the CView::OnInitialUpdate(), I get the window size by calling GetWindowRect(), then calling OnSize() with the width & height of this rectangle. For some reason, these values are very large (or negative) so that the OnSize() method creates child windows that are way off the screen. Any ideas for helping me get this fixed would be appreciated. Thanks, Royce
-
Hi, I have a CFormView-based application in which I am having a weird window sizing problem. On startup, my view window is very large vertically. It is so large that I can't see the top or the bottom of the window - it is completely off the screen. In the CView::OnInitialUpdate(), I get the window size by calling GetWindowRect(), then calling OnSize() with the width & height of this rectangle. For some reason, these values are very large (or negative) so that the OnSize() method creates child windows that are way off the screen. Any ideas for helping me get this fixed would be appreciated. Thanks, Royce
If you use
GetWindowRect and ScreenToClient
then size from your window isnt right_**
**_
WhiteSky
-
Hi, I have a CFormView-based application in which I am having a weird window sizing problem. On startup, my view window is very large vertically. It is so large that I can't see the top or the bottom of the window - it is completely off the screen. In the CView::OnInitialUpdate(), I get the window size by calling GetWindowRect(), then calling OnSize() with the width & height of this rectangle. For some reason, these values are very large (or negative) so that the OnSize() method creates child windows that are way off the screen. Any ideas for helping me get this fixed would be appreciated. Thanks, Royce
RoyceF wrote:
For some reason, these values are very large (or negative)...
Wouldn't that be expected since the window starts out too large for the screen?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb