UP

解决方案 »

  1.   

    不懂?
    BN_CLIECKED消息 并不属于cstatic的啊
     你给它发了 又有什么用
    你应该接受的是  比如 wm_lbuttondown的消息 这个才是cwnd的消息
    而BN_CLIECKED是cbutton的消息
      

  2.   

    我试了试,把一个Static的notify属性勾上,它就会有BN_CLIECKED消息。
      

  3.   

    不是呀,往上面加控加可以,但是自己创建不行呀!
    没有notify,怎么响应?
      

  4.   


    知道了
    The CStatic class provides the functionality of a Windows static control. A static control displays a text string, box, rectangle, icon, cursor, bitmap, or enhanced metafile. It can be used to label, box, or separate other controls. A static control normally takes no input and provides no output; however, it can notify its parent of mouse clicks if it's created with SS_NOTIFY style.你在create时候加个SS_NOTIFY风格
    应该就可以了吧!
      

  5.   

    这里有个办法
    1.先从CStatic类中派生出一个子类CYourStatic;
    2.然后在类向导或类查看器中响应它的BN_CLIECKED事件
    3.在你的Dlg类中声明一个CYourStatic变量(这就是你需要的Static)
    4.创建这个Static
    m_s.Create("Dfd",WS_VISIBLE|SS_NOTIFY,CRect(100,50,120,60),this);
    这样就可以了.
    这样是把BN_ClIECKED事件由自己来响应,而不是依靠消息反射由父窗口来响应.
      

  6.   

    right!I just have test this method .and it tell me the method is right!