CEdit回车自动换行,动态创建菜单

CEdit 控件属性设置
Multiline,Vertical scroll,AutoVScroll,Want Return,4个属性设置为true.就是按回车自动换行。

===环境:VS2008

CMenu   menu1;
POINT   curPos;

menu1.CreatePopupMenu();
SetForegroundWindow();
CMenu   *p;

menu1.AppendMenu(MF_POPUP,   (UINT)menu1.m_hMenu,   "File ");

menu1.AppendMenu(MF_STRING|MF_ENABLED,ID_AA, "aaaaaaaaaa ");
p=menu1.GetSubMenu(0);
p-> AppendMenu(MF_POPUP,   (UINT)p-> m_hMenu,   "File ");
#define   ID_NUMBER_CAMERA   100
CMenu   *pp;
pp=p-> GetSubMenu(0);
pp-> AppendMenu(MF_STRING|MF_ENABLED,ID_NUMBER_CAMERA, "nihaoma ");

::GetCursorPos(&curPos);
int   nSelection=menu1.TrackPopupMenu(TPM_LEFTBUTTON   |   TPM_LEFTALIGN   |  
TPM_BOTTOMALIGN|TPM_NONOTIFY|TPM_RETURNCMD,curPos.x,curPos.y,this);
if(nSelection   ==   1000){
m_check   =   !m_check;

// MessageBox( "1000 ");
}

menu1.DestroyMenu();
p-> DestroyMenu();
pp-> DestroyMenu();

你可能感兴趣的:(自动换行)