如何在对话框中更改控件的位置 [英] how to change the position of controls in a dialog

查看:86
本文介绍了如何在对话框中更改控件的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我有一个带有某些控件的基于对话框的应用程序.我想根据某些条件更改控件的位置.除了SetWindowPos()和MoveWindow()之外,是否还有其他方法可以更改位置?请帮帮我..

hi all,
i''ve one dialog based application with some controls.i want to change the position of controls based on some conditions.is there any methods other than SetWindowPos() and MoveWindow()to change the position?please help me..
thank you in advance..

推荐答案

到目前为止,我已经看到SetWindowPos或MoveWindow用于移动子窗口.但是为什么不想使用这些子窗口据我所知,这两个函数(SetWindowPosMoveWindow)很好用,您能解释它们的问题吗?
Till now i have seen SetWindowPos or MoveWindow are used to move a child window.But why you don''t want to use these methods?Can you explain what is the problem with them?


为什么要说它们不能正常工作?
The two functions (SetWindowPos and MoveWindow), as far as I know work well. Why are you saying they didn''t work properly?


这仅仅是必须是您输入的代码的结果!

我只是按照此处给出的指示进行操作 [
It simply must be a result of the code you have entered!

I just followed the directions given here[^], for creating an app with a webbrowser control in a dialog.

I just left the default dialog as it was and added a webbrowser control to it. After creating a member variable to access it with, I entered the following code into the event handler code for the OK button. Works exactly as advertised - pixel perfect. Right place, right size..

void CwebBrowserControlDlg::OnBnClickedOk()
{
    MessageBox(L"Clicked It", L"Info", MB_OK);
    m_Explorer.MoveWindow(0,0, 300, 100, true);
    // TODO: Add your control notification handler code here}


这篇关于如何在对话框中更改控件的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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