Click here to Skip to main content
15,892,480 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I haven't found that where can I insert some pictures into this Code Project Questions Page.So I would describe the question by language description.

I wrote a MFC dialog-based program.There is an area in the dialog which is not the main,I put three Radio Button Controls and One List Control in the area.The List Control was used to display the data needed.There are three kinds of data which saved in the form of Map Container,in a word,three maps.Each Radio Button stands for its related map data.I want to realize that the List Control displays the correspnding map data as soon as I clicks the corresponding Radio Button Control.By the way,the List Control shows the different column names(columns) when clicks the one Radio Button Control.The data is real-time changed or refreshed.So the data-flashing and window-flashing are also the problems.

So is there any better ways to realize this purpose?

What I have tried:

I tried one way.But the data-flashing and window-flashing is a bit serious.The speed also slow down .
Posted
Updated 17-Aug-17 23:54pm
Comments
Pascal-78 18-Aug-17 5:50am    
Did you try the LockWindowUpdate method to avoid window-flashing? It may also speed-up a little (because insertion of new item in the list will not start a new redraw).
Mark Danniel 19-Aug-17 3:54am    
Thanks.I'll have a try.

You can create three list controls where only the active one is visible and the others are made invisible using ShowWindow().

The hidden lists can then still be updated in the background. If you have to change the content of the visible list and must update multiple items, you should disable redrawing while modifying the list (CListCtrl::SetRedraw()).
 
Share this answer
 
Comments
Mark Danniel 19-Aug-17 4:01am    
Thanks.But I have a question about your answer.I want to use the only one area to show the data needed.After creating three List Controls,then how to locate these three List Controls in one area.Can you describe it in details ? Thanks very much!
Jochen Arndt 19-Aug-17 6:47am    
They should be all located at the same position. The not visible ones will not hide the others. Even if they would, the topmost one could be selected by changing the Z-order.
 
Share this answer
 
Comments
Mark Danniel 19-Aug-17 3:54am    
Thanks.I'll have a look at this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900