显示和隐藏不同对话框的控件 [英] showing and hiding controls of different dialog
本文介绍了显示和隐藏不同对话框的控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
您应该选择一种在对话框之间发送数据的方法.
您可以在每个应该接收信息的对话框中放置一些公共函数,以便从原始对话框中调用它们,然后在目的地对话框中作出反应.
您还可以将消息发送到具有数据结构的不同对话框...
为了显示或隐藏控件,您可以将ShowWindow函数与SW_HIDE或SW_SHOW一起使用;
Joan的回答是正确的...但是我要补充一点,MFC的正确方法是这是通过SendMessage()
或PostMessage()
以及接收对话框中的事件处理程序进行的(事件处理程序将管理内部控件).
hi all, i''ve a dialog based application.where in i''ve 3 dialogs.i want to clear all the controls which are displying on all dialogs by changing the combobox items.that means, the controls on dialog should be based on combobox value.i''ve tried with events, but in that, it is showing the new controls along with the previous controls.i want to hide all previous controls and want to show the new controls.how can i move with this?please help me..
thank you in advance.
解决方案
You should choose a method to send data between dialogs.
You can put some public functions in each dialog that should receive information in order to call them from the original one and then react in the destiny dialogs.
You can also send messages to the different dialogs with a structure with data...
In order to show or hide controls you can use the function ShowWindow with SW_HIDE or SW_SHOW;
Joan''s answer is correct... but I would add that the MFC proper way of doing this is throughSendMessage()
orPostMessage()
and an event handler in the receiving dialog (the event handler would manage the internal controls).
这篇关于显示和隐藏不同对话框的控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文