TA的每日心情 | 开心 2022-1-9 18:18 |
---|
|
发表于 2011-12-3 18:11:16
|
显示全部楼层
你自己对比下代码,代码如下,运行正常.
- HELE hMenuBar=NULL;
- bool CALLBACK My_EventBtnClick(HELE hEle,HELE hEventEle)
- {
- //菜单条操作
- XMenuBar_DeleteMenuItem(hMenuBar,0,202);
- return false;
- }
- //菜单条
- int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
- {
- XInitXCGUI();
- //创建窗口
- HWINDOW hWindow=XWnd_CreateWindow(400,200,300,200,L"炫彩界面库-窗口");
- XWnd_ShowWindow(hWindow,SW_SHOW);
- //创建菜单条
- hMenuBar=XMenuBar_Create(10,10,300,30,hWindow);
-
- //添加菜单条按钮
- XMenuBar_AddButton(hMenuBar,L"文件");
- XMenuBar_AddButton(hMenuBar,L"编辑");
- XMenuBar_AddButton(hMenuBar,L"视图");
- //添加弹出菜单项
- XMenuBar_AddMenuItemImage(hMenuBar,0,201,L"111",XMENU_ROOT,NULL,L"image\\149.gif");
- XMenuBar_AddMenuItemImage(hMenuBar,0,202,L"222",XMENU_ROOT,NULL,L"image\\150.gif");
- XMenuBar_AddMenuItem(hMenuBar,0,-1,NULL,XMENU_ROOT,XM_SEPARATOR);
- XMenuBar_AddMenuItemImage(hMenuBar,0,203,L"333",XMENU_ROOT,NULL,L"image\\151.gif");
- XMenuBar_AddMenuItem(hMenuBar,1,204,L"444");
- XMenuBar_AddMenuItem(hMenuBar,1,205,L"555");
- XMenuBar_AddMenuItem(hMenuBar,1,206,L"666");
- XMenuBar_AddMenuItem(hMenuBar,2,207,L"777");
- XMenuBar_AddMenuItem(hMenuBar,2,208,L"888");
- XMenuBar_AddMenuItem(hMenuBar,2,209,L"999");
- XMenuBar_AddMenuItem(hMenuBar,0,217,L"3-11",203);
- XMenuBar_AddMenuItem(hMenuBar,0,218,L"3-22",203);
- XMenuBar_AddMenuItem(hMenuBar,0,219,L"3-33",203);
- HELE hButton=XBtn_Create(10,10,60,20,L"按钮",hWindow);
- XEle_RegisterEvent(hButton,XE_BNCLICK,My_EventBtnClick);
- XRunXCGUI();
- return 0;
- }
复制代码
|
|