FormView override doubt
-
Hello! I'm overriding OnActivateView function in my CFormView derived class, and it is in that function that i'm creating and displaying some objects, the number of objects depends on a database query. In order to resize my form, i must have its CRect parameters. Inside OnActivateView i do : GetClientRect(&myRect);, but all the size parameters (left, top, right, bottom) are equal to 0. Maybe i'm wrong but i understand that these values should only be available when OnActivateView is finished. My question: Is there an onverride for CFormView that is called after OnActivateView and where CRect parameters are available? Thank you in advance
-
Hello! I'm overriding OnActivateView function in my CFormView derived class, and it is in that function that i'm creating and displaying some objects, the number of objects depends on a database query. In order to resize my form, i must have its CRect parameters. Inside OnActivateView i do : GetClientRect(&myRect);, but all the size parameters (left, top, right, bottom) are equal to 0. Maybe i'm wrong but i understand that these values should only be available when OnActivateView is finished. My question: Is there an onverride for CFormView that is called after OnActivateView and where CRect parameters are available? Thank you in advance
-
Well, i'm a beginner and, I want to execute the following piece of code just after OnActivateView. I am not sure about OnDraw(). I tried placing the code in OnDraw() but I got a flickering screen. CRect myRect; CSize mySize; GetClientRect(&myRect); if (myRect.bottom<=y) //y is the vertical position of my last object { myRect.bottom+=200; MoveWindow(&myRect, TRUE); mySize=myRect.Size(); SetScrollSizes(MM_TEXT, mySize); GetParentFrame()->RecalcLayout(); } What am I doing wrong? Thanks for your trouble.
-
Well, i'm a beginner and, I want to execute the following piece of code just after OnActivateView. I am not sure about OnDraw(). I tried placing the code in OnDraw() but I got a flickering screen. CRect myRect; CSize mySize; GetClientRect(&myRect); if (myRect.bottom<=y) //y is the vertical position of my last object { myRect.bottom+=200; MoveWindow(&myRect, TRUE); mySize=myRect.Size(); SetScrollSizes(MM_TEXT, mySize); GetParentFrame()->RecalcLayout(); } What am I doing wrong? Thanks for your trouble.
-
u are flickering i guess cos MoveWindow( LPCRECT lpRect, BOOL bRepaint = TRUE ); This means that ur sending a WM_PAINT message froom within the OnDraw, try changing it to FALSE Papa while (TRUE) Papa.WillLove ( Bebe ) ;
I tried that, with and without GetParentFrame()->RecalcLayout(); And in none of those ways i got satisfactory results. I'm doing like : void CStocks::OnDraw(CDC* /*pDC*/) { CRect myRect; CSize mySize; GetClientRect(&myRect); if (myRect.bottom<=m_iLastY) { myRect.bottom+=500; MoveWindow(&myRect, FALSE); mySize=myRect.Size(); SetScrollSizes(MM_TEXT, mySize); //GetParentFrame()->RecalcLayout(); } } After OnActivateView is finished, i have the final value for m_iLastY, and then iwant to use it to resize, is there an alternative to OnDraw? Am i doing something wrong? Thank again
-
I tried that, with and without GetParentFrame()->RecalcLayout(); And in none of those ways i got satisfactory results. I'm doing like : void CStocks::OnDraw(CDC* /*pDC*/) { CRect myRect; CSize mySize; GetClientRect(&myRect); if (myRect.bottom<=m_iLastY) { myRect.bottom+=500; MoveWindow(&myRect, FALSE); mySize=myRect.Size(); SetScrollSizes(MM_TEXT, mySize); //GetParentFrame()->RecalcLayout(); } } After OnActivateView is finished, i have the final value for m_iLastY, and then iwant to use it to resize, is there an alternative to OnDraw? Am i doing something wrong? Thank again
-
Check void ResizeParentToFit( BOOL bShrinkOnly = TRUE ); guess it could help u Papa while (TRUE) Papa.WillLove ( Bebe ) ;
Thanks again Papa! But i don't think i must use OnDraw, i just want to find a way of calling some code after OnActivateView is finished. Is that possivel?...I even thougth on using timers... Thanks