简体   繁体   English

关于MFC对话栏

[英]regarding mfc dialog bar

I am new to MFC and VC++ programming. 我是MFC和VC ++编程的新手。 I have two questions: 我有两个问题:

  • How do I make a resizable dialog bar? 如何制作可调整大小的对话框栏?
  • How do I give background color for a dockable dialog bar? 如何为可停靠对话框栏提供背景颜色?

Thanks! 谢谢!

So i assume we are working in visual studios 2008 or similar and i assume you have an MFC SDI or MDI application that you are working on. 因此,我假设我们正在Visual Studio 2008或类似产品中工作,并且我假设您正在使用MFC SDI或MDI应用程序。

  • Open the resource viewer (View->resource view). 打开资源查看器(“视图”->“资源”视图)。
  • Expand the project that you would like to place the dialog in. 展开要放置对话框的项目。
  • Expand to the dialog folder. 展开到对话框文件夹。
  • Right click this folder and click add resource. 右键单击该文件夹,然后单击添加资源。
  • Expand and add a new dialog bar. 展开并添加一个新的对话框。
  • Give it any properties you like using the properties window. 使用属性窗口为它提供任何您喜欢的属性。
  • To (display/ give context) your dialog bar, instantiate and get the handle of the dialog. 要(显示/提供上下文)对话框栏,请实例化并获取对话框的句柄。 Like 喜欢

    GetDlgItem(ID)-> ShowWindow(SW_SHOW);//show

Where ID is the id of the dialog. 其中, ID是对话框的ID。 You can obtain this by going into the resource viewer, right click on the dialog, properties, and the ID is given in there. 您可以通过进入资源查看器,右键单击对话框,属性并在其中提供ID来获得此信息。

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

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