怎样限制在cell中能输入的字符的个数呢???
具体请看:
http://expert.csdn.net/Expert/topic/1429/1429297.xml?temp=.9110681还有我定义了离开CELL的消息响应函数:
ON_NOTIFY(GVN_ENDLABELEDIT, IDC_GRID, OnGridEndEdit)
而此函数只有在CELL中的内容改变了才会响应,我怎么能让它不管CELL中的内容是否改变,只要离开CELL了就响应呢?

解决方案 »

  1.   

    重载函数,然后你就可以作限制了。
    OnKillFocus()失去焦点时的响应函数
      

  2.   

    让 你的CInplaceEdit  响应en_maxtext的消息
      

  3.   

    to E17(守护星) :
    en_maxtext的消息响应函数中的代码如何写? 
    谢了!
      

  4.   

    我上次说的也是我在Codeproject看的,你看看这个回复:
    You can use the Validate-method ...Create a new cell-class (from CGridCell ...) and add the ValidateEdit()-function (look in CGridCellBase-definition) !In this function you can check the string (CString::GetLength()) and return TRUE/FALSE if valid or not !ValidateEdit() is called in the CGridCtrl::ValidateEdit()-method ... and this is called in CGridCtrl::OnEndEditCell ...So you have nothing to do except to define the ValidateEdit-method in your cell-class ...Simple ... isn't it ??? *ggg*cr97