For days I am struggling to solve a drawing issue on CTabView derived. Might be simple to solve this, but I didn't make it yet, and I decided to put this here, hoping to get some help.
I even reproduce this into a test application in order to have clear image about this. (I attach test project below).
I have an MDI app, and in CChildFrame I have splitter just like this:
| | listview
| tree |
| |
| |
| |
In tree-view, regarding where is selected, I dynamically show another CTabView, and this CTabView has several CListViews, just like this:
When I change an specific item into tree-view, the tabbed view is showing up, and the first tab (which contain an CListView) is activated. The problem is that this CListView, is not drawing well (for isntance, it hasn't horizontal scrollbar) !!!
If I change manually some listview from CTabView, they are drawn well, even if I select back the first tabview.
Scenario:
I change an item in tree. CTabView is switching as visible, and the first tab is activated. This tab, having a CListView inside has NOT drawn well (no horizontal scrollbar).
I manually change another tab in tabview, the listview inside are drawn well.
I manually change the first tab, with listview inside. This time, the listview inside of had drawn well.
Could you cut a little time from yours and give a little help ? It would means a lot for me.
I come back immediately with what I have tried already.
Last edited by mesajflaviu; April 7th, 2017 at 08:46 AM.
CMFCTabCtrl& MFCTabCtrl = GetTabControl();
for(int i = 0;i < MFCTabCtrl.GetTabsNum();++i)
{
SendMessage(AFX_WM_CHANGING_ACTIVE_TAB, i, 0);
}
these calls I fired them right after tree item change selection, or through post messages, after tree item change selection. None of above trials had worked.
Last edited by mesajflaviu; April 7th, 2017 at 04:12 AM.
I noticed something: during childframe resizing, the hidden horizontal scrollbar of listview are flickering, but when I stopped resizing, the horizontal scrollbar remain hidden ... very strange ....
The same came when I resize the listview headers, of ANY CTabView tab with CListView inside .... now become more strange !
Last edited by mesajflaviu; April 7th, 2017 at 10:47 AM.
I would change the app to use a pseudo tab view. What I mean here is to use a tab control but don't add list control to each tab. Instead, size the tab control so that only the tabs appear and use a single list control. When the user changes tabs, just repopulate the same list control (and change the columns and rows as appropriate per each selected tab).
I would change the app to use a pseudo tab view. What I mean here is to use a tab control but don't add list control to each tab. Instead, size the tab control so that only the tabs appear and use a single list control. When the user changes tabs, just repopulate the same list control (and change the columns and rows as appropriate per each selected tab).
Being this problem (see the post above), I don't think that this is solve the problem, and it would complicate the code ... I guess ...
Last edited by mesajflaviu; April 9th, 2017 at 02:12 AM.
Being this problem (see the post above), I don't think that this is solve the problem, and it would complicate the code ... I guess ...
With the tab view you have a hiearchy of the tab window, tab pages and multiple list controls (and the scrollbars of one level interfering with each other). My suggestion flattens the hierarchy so the tab control is no longer the parent of the tab page and list control.
Is there a reason that a CListView should not be able to redrawn ? After I add new view in tabview at runtime, all CListView are not drawn properly (I can see scrollbars only if I move the mouse over scrollbar area).
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.