我继承了EDIT类,自己写了一个编辑框,想让这个编辑框没有边框。
下面是我的代码:
void CNameEdit_::PreSubclassWindow()
{
// TODO: 在此添加专用代码和/或调用基类
long l_UserStyle=::GetWindowLong(this->m_hWnd,GWL_STYLE); l_UserStyle|=~WS_BORDER; ::SetWindowLong(this->m_hWnd,GWL_STYLE,l_UserStyle); CEdit::PreSubclassWindow();
}
这样没反映求解,请用上面的方法来达到我的效果,当然也可以说一下其它方法

解决方案 »

  1.   

    l_UserStyle|=~WS_BORDER;改为l_UserStyle&=~WS_BORDER;
      

  2.   

    在create的时候就应该设置他的样式
      

  3.   

    Many styles   only   apply   at   window   creation   time   and   changing   the   style   bits   after   creation 
    has   no   effect,   hence   the   ModifyStyleEx   will   probably   do   nothing.   You   need   to   use   the 
    CreateEx   method   (which   is   what   Create   actually   calls,   with   a   0   for   the   EX-styles)   and   pass 
    the   parameter   in   at   creation   time.   
      

  4.   

    只有在Create/CreateEx动态创建窗口的时候指定风格。。
      

  5.   

    可以用类似透明按钮的方法在onpaint里画一幅和北京窗口一样的图遮住边框,就达到了无边框的效果了