关于在MFC编程中将单选按钮控件与列表控件组合的问题 [英] A question about combining radio button controls with list controls in MFC programming

查看:73
本文介绍了关于在MFC编程中将单选按钮控件与列表控件组合的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我还没有找到在哪里可以将一些图片插入此代码项目问题页面。所以我会用语言描述来描述问题。



我写的一个基于MFC对话框的程序。对话框中有一个区域不是主要区域,我在区域中放置了三个单选按钮控件和一个列表控件。列表控件用于显示所需的数据。有三种类型以地图容器形式保存的数据,一个字,三个地图。每个单选按钮代表其相关的地图数据。我想知道列表控件只要我点击相应的单选按钮控件就会显示相应的地图数据。顺便说一下,当单击一个单选按钮控件时,列表控件显示不同的列名(列)。数据是实时更改或刷新的。因此数据闪烁和窗口闪烁也是问题。 />


那么有没有更好的方法来实现这个目的?



我尝试过:



我试过一种方式。但是数据闪烁和窗口闪烁有点严重。速度也慢了。

解决方案

您可以使用 ShowWindow()创建三个列表控件,其中只有活动的一个可见,而其他列表控件不可见。



隐藏列表仍然可以在后台更新。如果您必须更改可见列表的内容并且必须更新多个项目,则应在修改列表时禁用重绘( CListCtrl :: SetRedraw())。

请参阅 Windows屏幕闪烁的mfc - Google搜索 [< a href =https://www.google.com/search?q=windows+screen+flickering+mfctarget =_ blanktitle =New Window> ^ ]。


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 .

解决方案

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()).


See windows screen flickering mfc - Google Search[^].


这篇关于关于在MFC编程中将单选按钮控件与列表控件组合的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆