如题。

解决方案 »

  1.   

    edit 是没有 drawitem 属性的
      

  2.   

    但从CEdit派生的新类中可以自己处理WM_DRAWITEM消息的,这样就有了。
      

  3.   

    但是 DRAWITEMSTRUCT 明确说了 CtlType 是没有 CEdit的。typedef struct tagDRAWITEMSTRUCT {
        UINT   CtlType;
        UINT   CtlID;
        UINT   itemID;
        UINT   itemAction;
        UINT   itemState;
        HWND   hwndItem;
        HDC    hDC;
        RECT   rcItem;
        DWORD  itemData;
    } DRAWITEMSTRUCT
    CtlType:
    The control type. The values for control types are as follows: 
    ODT_BUTTON   Owner-drawn button
    ODT_COMBOBOX   Owner-drawn combo box
    ODT_LISTBOX   Owner-drawn list box
    ODT_MENU   Owner-drawn menu
    ODT_LISTVIEW   List view control
    ODT_STATIC   Owner-drawn static control
    ODT_TAB   Tab control 
      

  4.   

    在CEdit的派生类中,得到控件的DC后自己绘制控件的背景。