那为兄弟有MFC上重写CEdit类的代码?最好是wince5.0上能跑的谢谢   有的话,能不能帮忙发我邮箱?[email protected]

解决方案 »

  1.   

    你想实现什么?
    class CMyEdit : public CEdit
    {
    };
    这就算重写了。
      

  2.   

    想用Win32 API 写个 CEdit 一样的类??
      

  3.   

    头文件class CEdit : public CWnd
    {
    DECLARE_DYNAMIC(CEdit)// Constructors
    public:
    CEdit();
    BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);// Attributes
    BOOL CanUndo() const;
    int GetLineCount() const;
    BOOL GetModify() const;
    void SetModify(BOOL bModified = TRUE);
    void GetRect(LPRECT lpRect) const;
    DWORD GetSel() const;
    void GetSel(int& nStartChar, int& nEndChar) const;
    HLOCAL GetHandle() const;
    void SetHandle(HLOCAL hBuffer);
    #if (WINVER >= 0x400)
    void SetMargins(UINT nLeft, UINT nRight);
    DWORD GetMargins() const;
    void SetLimitText(UINT nMax);
    UINT GetLimitText() const;
    CPoint PosFromChar(UINT nChar) const;
    int CharFromPos(CPoint pt) const;
    #endif // NOTE: first word in lpszBuffer must contain the size of the buffer!
    int GetLine(int nIndex, LPTSTR lpszBuffer) const;
    int GetLine(int nIndex, LPTSTR lpszBuffer, int nMaxLength) const;// Operations
    void EmptyUndoBuffer();
    BOOL FmtLines(BOOL bAddEOL); void LimitText(int nChars = 0);
    int LineFromChar(int nIndex = -1) const;
    int LineIndex(int nLine = -1) const;
    int LineLength(int nLine = -1) const;
    void LineScroll(int nLines, int nChars = 0);
    void ReplaceSel(LPCTSTR lpszNewText, BOOL bCanUndo = FALSE);
    void SetPasswordChar(TCHAR ch);
    void SetRect(LPCRECT lpRect);
    void SetRectNP(LPCRECT lpRect);
    void SetSel(DWORD dwSelection, BOOL bNoScroll = FALSE);
    void SetSel(int nStartChar, int nEndChar, BOOL bNoScroll = FALSE);
    BOOL SetTabStops(int nTabStops, LPINT rgTabStops);
    void SetTabStops();
    BOOL SetTabStops(const int& cxEachStop);    // takes an 'int' // Clipboard operations
    BOOL Undo();
    void Clear();
    void Copy();
    void Cut();
    void Paste(); BOOL SetReadOnly(BOOL bReadOnly = TRUE);
    int GetFirstVisibleLine() const;
    TCHAR GetPasswordChar() const;// Implementation
    public:
    virtual ~CEdit();
    };