CongUan
asked on
How can hide Vert Scrollbar of CHtmlView?
Hi all,
I have a problem that HtmlView control show a webpage, not need ScrollBar, but that Scrollbar is still there and is disabled.
I used ShowScrollBar(SB_VERT, FALSE);
but it is still displayed.
I have a problem that HtmlView control show a webpage, not need ScrollBar, but that Scrollbar is still there and is disabled.
I used ShowScrollBar(SB_VERT, FALSE);
but it is still displayed.
ASKER
I still see a Vert scrollbar when it display a webpage successfully.
have you tried above code ? or can you post some code that you have tried ??
ASKER
i tried above code.
where you have include following code in CHtmlView derived class function ??
ASKER
I included above code in OnDocumentComplete of ChtmlView derived class.
At my end on CHtmlView derived class its successfully hiding scrollbars in OnDocumentComplete event.
I performed following test to ensure its working :
I downloaded following sample with src which use CHtmlView : http://www.codeproject.com/miscctrl/chtmlview_search.asp. In CHtmlView_SearchView.CPP
Edit any function CCHtmlView_SearchView::Fin dText() and copy paste above code at end of function. In search box typed something and pressed enter and Vert scrollbar vanished.
-MAHESH
I downloaded following sample with src which use CHtmlView : http://www.codeproject.com/miscctrl/chtmlview_search.asp. In CHtmlView_SearchView.CPP
Edit any function CCHtmlView_SearchView::Fin
-MAHESH
ASKER
still not work. i put above code into a function and call it anytime.
CongUan ,
It will be better if you post code about how you put above code in function and called if from where.. to resolve this..
-MAHESH
It will be better if you post code about how you put above code in function and called if from where.. to resolve this..
-MAHESH
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just put following code to hide scrollbar of CHtmlView
IHTMLDocument2 *lpHtmlDocument = NULL;
LPDISPATCH lpDispatch = NULL;
lpDispatch = GetHtmlDocument();
ASSERT(lpDispatch);
lpDispatch->QueryInterface
ASSERT(lpHtmlDocument);
lpDispatch->Release();
CComQIPtr<IHTMLDocument2>p
CComPtr<IHTMLElement>piEle
CComPtr<IHTMLBodyElement>p
piDoc->get_body(&piElem);
piElem->QueryInterface(&pi
piBody->put_scroll(CComBST
-MAHESH