【问题标题】:How to remove the border of the client area of a window?如何去除窗口客户区的边框?
【发布时间】:2009-01-08 07:39:10
【问题描述】:

我不希望看到窗口客户区的边框。有什么办法可以去除它们吗?该窗口是一个 SDI(单文档)窗口。

我还注意到边框只出现在客户区的顶部和左侧(没有出现在右侧和底部)。我很困惑。

非常感谢!

【问题讨论】:

  • 您使用什么语言/平台进行开发?
  • 我在 Visual Studio 2005 上使用 MFC

标签: mfc client border area


【解决方案1】:

这样的东西对你有用吗?

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
    cs.style = WS_POPUP | WS_VISIBLE;  // or others you want
    cs.dwExStyle = 0;  // or others you want

    return CFrameWnd::PreCreateWindow(cs);
}

这涉及重载CWnd::PreCreateWindow 以修改为窗口定义初始化参数的CREATESTRUCT

dwExStyle 指的是扩展样式。

【讨论】:

    猜你喜欢
    • 2011-01-24
    • 2021-08-16
    • 2023-02-26
    • 1970-01-01
    • 1970-01-01
    • 2018-04-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多