views:

176

answers:

1

I'm creating a Windows Mobile 6 application using MFC Single Document Interface with CFormView base class.

I put CBitmapButton in the Form/Dialog resource and put them at the bottom. The CBitmapButtons fit nicely until a soft-keyboard appear or the application is covered by other applications. In such case, unwanted scroll bars appear at the bottom and at the right of the screen.

How do I remove this scroll-bars? there is neither "vertical-scroll-bar" nor "horizontal-scroll-bar" options in the dialog resource.

Update: CFormView is derived from CScrollView, need to inspect CScrollView
Update: Why would I use CFormView (derived from CScrollView) if I don't want a scroll bar? ans: because I want a view that can contain controls (buttons, text boxes, etc).

A: 

Buried inside MFC source code, inside viewscrl.cpp, lies a function called void CScrollView::UpdateBars(). Inside that function, there is a gem called EnableScrollBarCtrl(SB_BOTH, FALSE);

Put this function call at the end of the OnInitialUpdate() and it will chase away the scroll bars.

Edit: The OnSize() needs to be overriden as well not to call the parent's OnSize()

afriza