简体   繁体   English

MFC如何隐藏对话框?

[英]How hide dialog MFC?

I need to create dialog and button.When I click on button with arrow dialog hide, it should looks like dialog moves to top and in ahother case shows for user. 我需要创建对话框和按钮。当我单击带有隐藏对话框的按钮时,它看起来像对话框移到顶部,并且在其他情况下为用户显示。 ShowWindow(SW_HIDE). ShowWindow(SW_HIDE)。 I know about it. 我知道 I guess to get CRect from window, change it and after that set it to ScreeToClient(). 我想从窗口中获取CRect,对其进行更改,然后将其设置为ScreeToClient()。 Probably somebody knows some examples with it or another ways? 也许有人知道一些例子或其他方式? thanks 谢谢

To hide or show a window, you use ShowWindow() as you indicated. 要隐藏或显示窗口,请按照指示使用ShowWindow()。 No rectangle needed. 不需要矩形。

Otherwise, please re-explain your question, I can't make head or tails of it. 否则,请重新解释您的问题,我无法说清楚。

Normally, if you need to show a dialog that contains settings (similar to the Visual Studio "Options" dialog) then what you would typically do is this: 通常,如果您需要显示一个包含设置的对话框(类似于Visual Studio的“选项”对话框),那么通常要做的是:

  • List item. 项目清单。
  • Create a CDialog-derived class. 创建一个CDialog派生的类。
  • Create an instance of that class. 创建该类的实例。
  • call DoModal on that object. 在该对象上调用DoModal。 This shows the dialog. 显示对话框。
  • Do nothing else. 什么也别做。 Once DoModal returns the dialog has been closed. 一旦DoModal返回,对话框将关闭。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM