更改焦点后,Picture Control会更改可见性 [英] Picture Control changed visibility after changed focus

查看:80
本文介绍了更改焦点后,Picture Control会更改可见性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里我正在开发基于MFC对话的应用程序,其中在选项卡控件中添加了多个子对话框;在一个子对话框中有多个图片控件,我在按钮点击事件上动态更改了位图图像,每当我点击其中一个图片控制并切换到另一个选项卡(用于测试目的)并返回当前图片控制选项卡,那时所有控件(我之前点击过)都是隐形的!

怎么样发生了变化以及如何解决这个问题???

Here I am working on MFC dialogue based application,in which there are multiple child dialogues added in tab control;In one child dialogue there are multiple picture controls and I changed bitmap image dynamically on button clicked event,whenever I clicked one of the picture controls and switched to another tab(for Testing purpose)and coming back to current picture control tab that time all controls(which I''ve clicked previous time)are invisible!!!
How that change occurred and how to solve that problem???

推荐答案

这取决于图片控件的类型:拥有的绘图,框架,位图等...

在OnTab事件上通过InvalidateRect()重试对话框。

或者设置对话框的WM_PAINT和GetDC(GetDlgItem(hDlg,ID_PICTURE_CONTROL))等等。

或者使用子分类技术并编写WM_PAINT事件代码。
This depends of type of the picture control: owned draw, frame, bitmap etc...
Try redraw dialog by InvalidateRect() on "OnTab" event.
Or set WM_PAINT of the dialog and GetDC( GetDlgItem( hDlg, ID_PICTURE_CONTROL) ) etc..
Or use sub classing tecnology and write code of WM_PAINT event.


这篇关于更改焦点后,Picture Control会更改可见性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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