Re: How to split a window into two... and I DON'T mean CSplitterWnd!
The only to get rid of the CFormView scrollbar is to call SetScrollSizes.
Here is what I would do, in your CFormView's WM_SIZE handler:
void CFormViewResizeView::OnSize(UINT nType, int cx, int cy)
CFormView::OnSize(nType, cx, cy);
//make sure that the controls are created.
//WM_SIZE is sent at least once before the controls are created.
//if the lable is already at 0,0, you can comment out this line!
//the edit control should take up the rest of the window
//the -50s are there to keep the scrollbar from flashing
When setting the scrollsize if you don't subtract a substantial amount from
the size, then when the window is shrunk the scrollbar will flash.
I found that 50 is a good number for keeping the scrollbar from flashing.
Also don't forget to set the WS_CLIPCHILDREN flag of the CFormView.
"FIihelahd" <email@example.com> wrote in message
I have a window that was originally a CEdit.
Now, I wanted to put a little caption on top of it, to describe what
As far as I'm aware, the options are:
1) Use a CFormView, and use static text, then put a CEdit control
2) Use a CSplitterWnd, and put the caption in the upper half, and the
CEdit in the lower half.
Now, I tried option 1)
it looks like this:
"Song Notes" is the caption I was talking about.
I want to split the window into two so that Song Notes is in the upper
dialog, and the CEdit is the lower part, taking up the entire lower
but option 1) has a major flaw. It's a CHEAT and it looks
unprofessional. I made the example small so you can see what happens
if there's a scrollbar... it's the scrollbar of the outer window, not
of the CEdit... There should not be two separate sets of scrollbars...
it should be as if the "Song Notes" part was just split with a
CSplitter, and the lower CEdit is really taking up the whole frame
option 2) sucks, you get a dumb splitter bar there which I don't want.
How do you do this right?