Click here to Skip to main content
15,886,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSimple Question (Listbox) Pin
Dane Grant23-Sep-07 12:38
Dane Grant23-Sep-07 12:38 
AnswerRe: Simple Question (Listbox) Pin
Mark Salsbery23-Sep-07 12:46
Mark Salsbery23-Sep-07 12:46 
QuestionCFormView - How to change size of a view dynamically to fit the client's frame window (without manually resizing parent window)? Pin
mfc_rookie23-Sep-07 11:16
mfc_rookie23-Sep-07 11:16 
AnswerRe: CFormView - How to change size of a view dynamically to fit the client's frame window (without manually resizing parent window)? Pin
Mark Salsbery23-Sep-07 12:56
Mark Salsbery23-Sep-07 12:56 
GeneralRe: CFormView - How to change size of a view dynamically to fit the client's frame window (without manually resizing parent window)? Pin
mfc_rookie23-Sep-07 18:09
mfc_rookie23-Sep-07 18:09 
GeneralRe: CFormView - How to change size of a view dynamically to fit the client's frame window (without manually resizing parent window)? Pin
JudyL_MD24-Sep-07 2:52
JudyL_MD24-Sep-07 2:52 
GeneralRe: CFormView - How to change size of a view dynamically to fit the client's frame window (without manually resizing parent window)? Pin
Vaclav_24-Sep-07 4:17
Vaclav_24-Sep-07 4:17 
GeneralRe: CFormView - How to change size of a view dynamically to fit the client's frame window (without manually resizing parent window)? Pin
JudyL_MD24-Sep-07 4:41
JudyL_MD24-Sep-07 4:41 
Vaclav_Sal wrote:
Am I missing something here?
The view frame is resized to fit the variable size of parent.
The parent size is subsequently changed.
So why RecalcLayout does not do the job by itself?


At a guess, because RecalcLayout only affects the frame window i.e. CMainFrame. Calling it implies that the frame size has changed and the scroll bars need to be adjusted to the new size, but there is no relation, with respect to this call itself, between the view and the frame. The call to ResizeParentToFit calculates what an appropriate client size should be and then tells the frame what it's new size should be.

From MSDN description of CScrolView::ResizeParentToFit

ResizeParentToFit assumes that the size of the view window has been set. If the view window size has not been set when ResizeParentToFit is called, you will get an assertion. To ensure that this does not happen, make the following call before calling ResizeParentToFit:

GetParentFrame()->RecalcLayout();


Judy
GeneralRe: CFormView - How to change size of a view dynamically to fit the client's frame window (without manually resizing parent window)? Pin
Mark Salsbery24-Sep-07 6:28
Mark Salsbery24-Sep-07 6:28 
GeneralRe: CFormView - How to change size of a view dynamically to fit the client's frame window (without manually resizing parent window)? Pin
mfc_rookie24-Sep-07 18:59
mfc_rookie24-Sep-07 18:59 
Questionhow to change sid Pin
Sudipta Mukherjee23-Sep-07 11:13
Sudipta Mukherjee23-Sep-07 11:13 
QuestionTCP stack fragments incoming data in my client/server app Pin
deerhunter8923-Sep-07 8:10
deerhunter8923-Sep-07 8:10 
AnswerRe: TCP stack fragments incoming data in my client/server app Pin
Mark Salsbery23-Sep-07 9:14
Mark Salsbery23-Sep-07 9:14 
QuestionCLI pipe io - reading/ writing simultaneously Pin
higgsbo23-Sep-07 7:50
higgsbo23-Sep-07 7:50 
QuestionSOLVED CTabCtrl and spinner control - where is is documented? [modified] Pin
Vaclav_22-Sep-07 18:54
Vaclav_22-Sep-07 18:54 
AnswerRe: CTabCtrl and spinner control - where is is documented? Pin
Mark Salsbery23-Sep-07 7:49
Mark Salsbery23-Sep-07 7:49 
GeneralRe: CTabCtrl and spinner control - where is is documented? Pin
Vaclav_23-Sep-07 12:49
Vaclav_23-Sep-07 12:49 
GeneralRe: CTabCtrl and spinner control - where is is documented? Pin
Mark Salsbery23-Sep-07 12:58
Mark Salsbery23-Sep-07 12:58 
GeneralRe: CTabCtrl and spinner control - where is is documented? Pin
Mark Salsbery23-Sep-07 13:29
Mark Salsbery23-Sep-07 13:29 
GeneralRe: CTabCtrl and spinner control - where is is documented? Pin
Vaclav_24-Sep-07 4:07
Vaclav_24-Sep-07 4:07 
GeneralRe: CTabCtrl and spinner control - where is is documented? Pin
Mark Salsbery24-Sep-07 6:09
Mark Salsbery24-Sep-07 6:09 
QuestionCheck Application Pin
Tjie Pouw22-Sep-07 18:21
Tjie Pouw22-Sep-07 18:21 
AnswerRe: Check Application Pin
Hamed Musavi22-Sep-07 22:17
Hamed Musavi22-Sep-07 22:17 
JokeRe: Check Application Pin
Sreedhar DV26-Sep-07 0:17
Sreedhar DV26-Sep-07 0:17 
JokeRe: Check Application Pin
Hamed Musavi26-Sep-07 1:20
Hamed Musavi26-Sep-07 1:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.