Click to See Complete Forum and Search --> : To remove Vertical & Horizontal Scroll Bars of a Form View


vattal
May 26th, 1999, 11:40 PM
I have created a view CMyView derived from CFormView. I have added the following code in init instance.
pDocTemplate1 = new CMultiDocTemplate(
IDR_MYVIEW,
RUNTIME_CLASS(CMyDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CMyView));

AddDocTemplate(pDocTemplate1);

This gives me a FormView. When I resize the view I get Horizontal & Vertical Scroll Bars. To avoid the Scroll Bars I have also used

GetParentFrame()->RecalcLayout();
ResizeParentToFit(FALSE);

in OnInitialUpdate() of the view class. By using this I will not get the scroll bars initially but the scroll bars appear when I resize the view (reduce the view).
I have also tried to modify the styles in PreCreate Window. But the scroll bars appear when I reduce the view. Is there any way to remove the scroll bars at any instant
Thanx
Adarsh S

Jason Teagle
May 27th, 1999, 03:00 AM
They appear because the page size, as known by the system, is larger than the actual window size. CFormView is derived from CScrollView, which maintains this page size.

You could try calling SetScrollSizes() in OnInitialUpdate() with a really small page size, say (1, 1). If the window ever gets that small, you won't be able to see the scroll bars anyway! This should cure it.