ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
http://111.231.102.37:84/DuiLib.html ![](https://box.kancloud.cn/919da495a3aaba01633225641701bb81_1575x493.png) **1.Btn按钮** ``` <Button name="minbtn" tooltip="最小化" float="true" pos="0,5,22,24" width="23" normalimage=" file='SysBtn\MinNormal.bmp' " hotimage=" file='SysBtn\MinFocus.bmp' " pushedimage=" file='SysBtn\MinFocus.bmp' "/> <Button name="maxbtn" tooltip="最大化" float="true" pos="22,5,44,24" width="23" normalimage=" file='SysBtn\MaxNormal.bmp' " hotimage=" file='SysBtn\MaxFocus.bmp' " pushedimage=" file='SysBtn\MaxFocus.bmp' " /> <Button name="restorebtn" visible="false" tooltip="还原" float="true" pos="22,5,44,24" width="23" normalimage=" file='SysBtn\StoreNormal.bmp' " hotimage=" file='SysBtn\StoreFocus.bmp' " pushedimage=" file='SysBtn\StoreFocus.bmp' " /> <Button name="closebtn" tooltip="关闭" float="true" pos="44,5,74,24" width="28" normalimage=" file='SysBtn\CloseNormal.bmp' " hotimage=" file='SysBtn\CloseFocus.bmp' " pushedimage=" file='SysBtn\CloseFocus.bmp' "/> ```` name="closebtn" 唯一标识按钮,其他按钮的name不能与其重复 tooltip="关闭" 就是那个提示条的文字 float="true" 代表按钮的位置是绝对定位,其位置由pos属性指定 pos="44,5,74,24" 代表按钮的位置矩阵,分别为矩阵左、上、右、下四个点 width="28" 代表按钮图片显示的宽度(这个可以不填,但是由于按钮图片没有做好,如果不填的话,图片会被拉伸有点失真) normalimage 代表正常状态下按钮显示的图片路径 hotimage 代表鼠标移上去时,按钮显示的图片路径 pushedimage 代表鼠标点击按钮时,按钮显示的图片路径 https://www.jianshu.com/p/4474f7a9b8b6 ```c++ virtual void Notify(TNotifyUI& msg) { if (msg.sType == _T("click")) { if (msg.pSender ->GetName() == _T("MainBtn")) { ::MessageBox(NULL,_T("我是主窗体"),_T("主窗体"),NULL); } if (msg.pSender ->GetName() == _T("closebtn")) { //关闭按钮 PostQuitMessage(0); } } } ```