CHtmlView - how to hide the scrollbar(s)?
-
:confused: I am trying to hide the scrollbar(s) in a CHtmlView without success. I have tried the following: In PreCreateWindow: cs.style ^= WS_VSCROLL; In OnInitialUpdate: ModifyStyle(WS_VSCROLL,0); and ShowScrollBar(SB_VERT,false); and CScrollBar* pSB=AfxGetMainWnd()->GetScrollBarCtrl(SB_VERT); returns NULL as do CScrollBar* pSB=GetScrollBarCtrl(SB_VERT); What is the correct way of doing this? Thank you in advance!
-
:confused: I am trying to hide the scrollbar(s) in a CHtmlView without success. I have tried the following: In PreCreateWindow: cs.style ^= WS_VSCROLL; In OnInitialUpdate: ModifyStyle(WS_VSCROLL,0); and ShowScrollBar(SB_VERT,false); and CScrollBar* pSB=AfxGetMainWnd()->GetScrollBarCtrl(SB_VERT); returns NULL as do CScrollBar* pSB=GetScrollBarCtrl(SB_VERT); What is the correct way of doing this? Thank you in advance!
-
:confused: I am trying to hide the scrollbar(s) in a CHtmlView without success. I have tried the following: In PreCreateWindow: cs.style ^= WS_VSCROLL; In OnInitialUpdate: ModifyStyle(WS_VSCROLL,0); and ShowScrollBar(SB_VERT,false); and CScrollBar* pSB=AfxGetMainWnd()->GetScrollBarCtrl(SB_VERT); returns NULL as do CScrollBar* pSB=GetScrollBarCtrl(SB_VERT); What is the correct way of doing this? Thank you in advance!
You need to get a pointer to the internal document of the view and set its scroll to 'no'. ___________ Klaus [www.vbbox.com]
-
You need to get a pointer to the internal document of the view and set its scroll to 'no'. ___________ Klaus [www.vbbox.com]
-
:confused: I am trying to hide the scrollbar(s) in a CHtmlView without success. I have tried the following: In PreCreateWindow: cs.style ^= WS_VSCROLL; In OnInitialUpdate: ModifyStyle(WS_VSCROLL,0); and ShowScrollBar(SB_VERT,false); and CScrollBar* pSB=AfxGetMainWnd()->GetScrollBarCtrl(SB_VERT); returns NULL as do CScrollBar* pSB=GetScrollBarCtrl(SB_VERT); What is the correct way of doing this? Thank you in advance!
The Webbrowser control queries the application COleControlSite for an interface called XDocHostUIHandler. Get the 'driller' sample from msdn which implements this control. If it founds it, it calls the method GetHostInfo(DOCHOSTUIINFO* pInfo ); In there, you have to put the following code: pInfo->dwFlags = DOCHOSTUIFLAG_SCROLL_NO; XDocHostUIHandler is good for setting other properties of the control and also for disable or replacing the context menu of the browser. - - - - - - - - - - - - - - - - - - Memory leaks is the price we pay \0 01234567890123456789012345678901234
-
The Webbrowser control queries the application COleControlSite for an interface called XDocHostUIHandler. Get the 'driller' sample from msdn which implements this control. If it founds it, it calls the method GetHostInfo(DOCHOSTUIINFO* pInfo ); In there, you have to put the following code: pInfo->dwFlags = DOCHOSTUIFLAG_SCROLL_NO; XDocHostUIHandler is good for setting other properties of the control and also for disable or replacing the context menu of the browser. - - - - - - - - - - - - - - - - - - Memory leaks is the price we pay \0 01234567890123456789012345678901234
Thanks a lot. This solved my problem. I only had to orverride CHtmlView::OnGetHostInfo(). FYI, here is all the code I had to add: HRESULT CYourView::OnGetHostInfo(DOCHOSTUIINFO* pInfo) { pInfo->dwFlags = DOCHOSTUIFLAG_SCROLL_NO; // default indicates we don't have info return S_OK; }
-
Thanks a lot. This solved my problem. I only had to orverride CHtmlView::OnGetHostInfo(). FYI, here is all the code I had to add: HRESULT CYourView::OnGetHostInfo(DOCHOSTUIINFO* pInfo) { pInfo->dwFlags = DOCHOSTUIFLAG_SCROLL_NO; // default indicates we don't have info return S_OK; }
I didn't know that CHtmlView had that fuction. I was ready to use other way in an application, but this is much more simple. Thanks for mention it. - - - - - - - - - - - - - - - - - - Memory leaks is the price we pay \0