|
例如设置无边框,但窗口被创建后会先显示为有边框,然后 闪一下 才改变为 无边框。
- // 在创建窗口前本方法会被提前调用,此时需要根据用户所设置的相关属性将pCreateParam->m_dwStyle和
- // pCreateParam->m_dwExStyle设置完整,以便调用方据此将窗口的用户区尺寸转换到窗口尺寸.
- void CVWnd_WinForm::OnPrepareWindowStyle (CVolNativeWndCreateParam* pCreateParam)
- {
- #ifndef _VOL_FOR_UI_DESIGNER // 不为编译布局设计器专用版本?
- if (IsEmptyStr (pCreateParam->m_szCaption) && m_blpControlBox)
- pCreateParam->m_szCaption = _T_VOL_USER_APP_NAME;
- // if (m_blpTransparent)
- // pCreateParam->m_dwExStyle |= WS_EX_TRANSPARENT;
- #endif
- pCreateParam->m_dwStyle |= WS_CLIPCHILDREN;
- if (m_npBorderType != 0)
- {
- if (IsEmptyStr (pCreateParam->m_szCaption) == FALSE || m_blpControlBox)
- pCreateParam->m_dwStyle |= (WS_CAPTION | WS_BORDER);
- if (m_blpControlBox)
- pCreateParam->m_dwStyle |= (WS_SYSMENU | WS_BORDER);
- #ifndef _VOL_FOR_UI_DESIGNER // 不为编译布局设计器专用版本?
- pCreateParam->m_dwStyle |= WS_DLGFRAME;
- #else
- pCreateParam->m_dwExStyle |= WS_EX_DLGMODALFRAME;
- #endif
- if (m_blpMaxBtn)
- pCreateParam->m_dwStyle |= WS_MAXIMIZEBOX;
- if (m_blpMinBtn)
- pCreateParam->m_dwStyle |= WS_MINIMIZEBOX;
- }
- switch (m_npBorderType)
- {
- case 1: // 普通可调边框
- pCreateParam->m_dwStyle |= WS_THICKFRAME;
- break;
- case 2: // 普通固定边框
- break;
- case 3: // 窄标题可调边框
- pCreateParam->m_dwStyle |= WS_THICKFRAME;
- case 4: // 窄标题固定边框
- pCreateParam->m_dwExStyle |= WS_EX_TOOLWINDOW;
- break;
- case 5: // 凹入式可调边框
- pCreateParam->m_dwStyle |= WS_THICKFRAME;
- case 6: // 凹入式固定边框
- pCreateParam->m_dwExStyle |= WS_EX_CLIENTEDGE;
- break;
- default:
- ASSERT (m_npBorderType == 0); // 无边框
- break;
- }
复制代码
|
|