zoukankan      html  css  js  c++  java
  • 添加菜单栏自绘按钮

      添加   ON_WM_NCPAINT  
      void   CMyDlg::OnNcPaint()    
      {  
      CDialog::OnNcPaint();//   for   painting   messages  
      CDC   *pDC=GetWindowDC();  
      //CPoint   pt;pt.x=2;pt.y=2;  
      //pDC->DrawIcon(pt,m_hIcon);  
      CRect   rc;GetWindowRect(&rc);  
      CPen   blackpen,graypen,whitepen;CPen   *oldpen;  
      whitepen.CreatePen(PS_SOLID,1,RGB(255,255,255));  
      graypen.CreatePen(PS_SOLID,1,RGB(180,180,180));  
      blackpen.CreatePen(PS_SOLID,1,RGB(100,100,100));  
      oldpen=pDC->SelectObject(&whitepen);  
      pDC->MoveTo(rc.Width()-30,16);  
      pDC->LineTo(rc.Width()-30,6);  
      pDC->LineTo(rc.Width()-22,6);  
      pDC->SelectObject(&graypen);  
      pDC->LineTo(rc.Width()-22,15);  
      pDC->LineTo(rc.Width()-30,15);  
      pDC->SelectObject(&blackpen);  
      pDC->MoveTo(rc.Width()-30,16);  
      pDC->LineTo(rc.Width()-22,16);  
      pDC->LineTo(rc.Width()-22,6);  
      CBrush   *pBrush=new   CBrush;pBrush->CreateSolidBrush(RGB(200,200,200));  
      pDC->FillRect(CRect(rc.Width()-29,7,rc.Width()-23,14),pBrush);  
      pDC->MoveTo(rc.Width()-28,12);  
      pDC->LineTo(rc.Width()-24,12);  
      pDC->SelectObject(oldpen);  
      pDC=new   CDC;  
      }  
      然后在自己处理ON_WM_NCLBUTTONDOWN事件

  • 相关阅读:
    利用windows 127.0.0.1:30000 代理在linux下工作
    nginx与ssh 把内网转为公网开发服务器
    php errorlog 记录
    dockerfile php 开发
    ubuntu
    k8s 1.9.1 centos7 install 离线安装
    kubernetes
    linux字符设备驱动--基本知识介绍
    linux应用程序设计--Makefile工程管理
    linux应用程序设计--GDB调试
  • 原文地址:https://www.cnblogs.com/buffer/p/1434689.html
Copyright © 2011-2022 走看看