15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


How to get rid of 'DOUBLE' scrollbars in CTreeView

dle@abbott.SanDiegoCA.ATTGIS.COM
Thursday, February 01, 1996


Hi,

I am writing this MDI application using the CView derived from 
CTreeview and the CChildFrame (created by the AppWizard) has
CSplitterWnd (1X2).  I then added some tree items (about 10) into
my CMyTreeview class.  Everything displays correctly.  But
when I resized the CChildFrame window smaller (in both vertical and
horizontal directions), I saw TWO vertical scrollbars and/or TWO 
horizontal scrollbars depending on the direction that I resized.

I think one scrollbar which belongs to the CChildFrame is always 
visible.  The other scrollbar (inside the CChildFrame) belongs to 
the CTreeview class and is only visible with the CTreeCtrl is small
enough.

My question is how do I get rid of the "Double" scrollbars.  I only
want ONE scrollbar (either vertical or horizontal).  

Here is how to create the problem.
- use the AppWizard to create a MDI application.
- Check the Splitter Window in the Advance... button (Step 4)
- Change the CView to derive from CTreeview
- Change the w_wndSplitterWnd.Create(1,2, ....);
- Add code to add tree items (about 10).
- Compile/run/resize.. Voila. 

thanks in advance.

--Jake

-- 



Jim Lavin -- ooptech@Onramp.NET
Saturday, February 03, 1996

At 01:05 PM 2/1/96 -0800, you wrote:
>
>Hi,
>
>
>My question is how do I get rid of the "Double" scrollbars.  I only
>want ONE scrollbar (either vertical or horizontal).  
>


The easiest way is to always resize the child view to fit the CFrameWindow.
This way the CFrameWindow will never think it needs to display a scroll bar
since all of it's children will be within it's client area.

Jim Lavin
OOP Technologies
http://emporium.turnpike.net/~jlavin
http://rampages.onramp.net/~ooptech






| Вернуться в корень Архива |