1.关于CString类型的类,该怎么判断他是否为空,如果为空值的话,怎么赋值?
2.怎么让程序响应鼠标双击事件和DEl键。试了好多次,都失败了。

解决方案 »

  1.   

    CString str;if(str.GetLength()==0)
     //空ClassWizard 啊。一下子說不清楚,還是多看書吧。
      

  2.   

    CString str;
    str.IsEmpty();
    str="12345";
      

  3.   

    CString str;
    str.GetLength()==0 或者str.IsEmpty();
      

  4.   

    鼠标双击是WM_LBUTTONDBLCLK~
    用ClassWizard 添加~
    DEl键?不知道~
    CString str;
    str.GetLength()==0 或者str.IsEmpty();
      

  5.   

    CString str;
    str.IsEmpty();
    鼠标双击是WM_LBUTTONDBLCLK,
    Del键的话就要通过OnKeyDown消息,
    然后根据它的扫描码来判断是否是Del键了
      

  6.   

    BOOL CString::IsEmpty()或者CString::GetLength()==0判断CString对象是否为空
    通过ClassWizard添加WM_LBUTTONDBLCLK消息,增加消息映射函数即可
    通过响应WM_KEYDOWN消息,增加消息映射函数,在函数中判断是不是Del键再增加相应的处理
      

  7.   

    CString str;
    str.GetLength()==0 或者str.IsEmpty();
    Del键在
    OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
    消息中的扫描码46