本文介绍了在更改图片后,如何确保CStatic仍然是最底层的窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 限时删除!! 大家好, 我有一个静态控件,我根据一些变量加载6位图图片。 在那个位图之上我想放一些按钮。 那个静态控件没有对话框那么大,它只是在顶部当对话框改变大小时,它会改变位置。 当我使用以下代码更改图片时按钮消失: hBMP =(HBITMAP)LoadImage(NULL,csPath,IMAGE_BITMAP, 0 , 0 ,LR_LOADFROMFILE); hbmpPrev = m_cstatPicture.SetBitmap((HBITMAP)hBMP); m_cstatPicture.SetWindowPos(& wndBottom, 0 , 0 , 0 , 0 ,SWP_NOSIZE | SWP_NOMOVE); 如何避免这种情况? 我希望这些按钮始终位于位图图像之上。 在程序中调用该代码之后,我尝试使用以下命令将按钮窗口设置为TOPMOST: pButton- > SetWindowPos(& wndTopMost,left,top,Width(),Height(),SWP_SHOWWINDOW); 但是仍然没有运气... 任何提示?解决方案 我的错误(一如既往处理C ++和事物时)不工作)。 我必须使所有内容都被绘制的对话框无效,不仅要显示我想要确定的控件...... :( Hello all,I do have a static control where I do load 6 bitmap pictures depending on some variables.On top of that bitmap I want to put some buttons.That static control is not as big as the dialog, it is just on top right and it changes position when the dialog changes sizes.when I do change the picture using the following code the buttons disappear:hBMP = (HBITMAP)LoadImage(NULL, csPath, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);hbmpPrev = m_cstatPicture.SetBitmap((HBITMAP)hBMP);m_cstatPicture.SetWindowPos(&wndBottom, 0,0,0,0, SWP_NOSIZE | SWP_NOMOVE);How can I avoid that?I'd like having those buttons always on top of the bitmap image.After calling that code in the program I try to set the button windows to be the TOPMOST using this:pButton->SetWindowPos(&wndTopMost, left, top, Width(), Height(), SWP_SHOWWINDOW);But still no luck...Any hint? 解决方案 My mistake (as always when handling with C++ and things don't work).I had to invalidate the dialog where everything is being drawn, not only the controls I want to be sure are shown... :( 这篇关于在更改图片后,如何确保CStatic仍然是最底层的窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 1403页,肝出来的..
09-07 12:32