设置WS_NOTIFY属性
Static的属性页->Styles->Notify钩上 
 

解决方案 »

  1.   

    自己继承一个CStatic类,处理 WM_WM_LBUTTONDBLCLK 就行了
      

  2.   

    自己继承一个CStatic类,处理 WM_LBUTTONDBLCLK 就行了
      

  3.   

    我做了个例子:http://61.140.78.114/fjj/test1.zip       (91k)快点给分哦~~~~~~
      

  4.   

    楼上的朋友,你好,我也试过了,为什么要NOTIFY勾上呢
      

  5.   

    Sorry
    设置SS_NOTIFY属性
    这个属性表示本控件接受某些消息,Static是比较特殊的控件之一
      

  6.   

    文件要删了,贴源码:
    // MyStatic.h : header file
    ///////////////////////////////////////////////////////////////////////////////
    // CMyStatic windowclass CMyStatic : public CStatic
    {
    // Construction
    public:
    CMyStatic();// Attributes
    public:// Operations
    public:// Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CMyStatic)
    //}}AFX_VIRTUAL// Implementation
    public:
    virtual ~CMyStatic(); // Generated message map functions
    protected:
    //{{AFX_MSG(CMyStatic)
    afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
    //}}AFX_MSG DECLARE_MESSAGE_MAP()
    };// MyStatic.cpp : implementation file
    //#include "stdafx.h"
    #include "test1.h"
    #include "MyStatic.h"#ifdef _DEBUG
    #define new DEBUG_NEW
    #undef THIS_FILE
    static char THIS_FILE[] = __FILE__;
    #endif/////////////////////////////////////////////////////////////////////////////
    // CMyStaticCMyStatic::CMyStatic()
    {
    }CMyStatic::~CMyStatic()
    {
    }
    BEGIN_MESSAGE_MAP(CMyStatic, CStatic)
    //{{AFX_MSG_MAP(CMyStatic)
    ON_WM_LBUTTONDBLCLK()
    //}}AFX_MSG_MAP
    END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////
    // CMyStatic message handlersvoid CMyStatic::OnLButtonDblClk(UINT nFlags, CPoint point) 
    {
    // TODO: Add your message handler code here and/or call default
    ::MessageBox(0,"ok.....la","",MB_OK); CStatic::OnLButtonDblClk(nFlags, point);
    }
    //////测试:
    // test1Dlg.h : header file
    //
    /////////////////////////////////////////////////////////////////////////////
    // CTest1Dlg dialog
    #include "mystatic.h"class CTest1Dlg : public CDialog
    {
    // Construction
    public:
    CTest1Dlg(CWnd* pParent = NULL); // standard constructor// Dialog Data
    //{{AFX_DATA(CTest1Dlg)
    enum { IDD = IDD_TEST1_DIALOG };
    CMyStatic m_mystatic1;
    //}}AFX_DATA // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CTest1Dlg)
    protected:
    virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
    //}}AFX_VIRTUAL// Implementation
    protected:
    HICON m_hIcon; // Generated message map functions
    //{{AFX_MSG(CTest1Dlg)
    virtual BOOL OnInitDialog();
    afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
    afx_msg void OnPaint();
    afx_msg HCURSOR OnQueryDragIcon();
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
    };