设为首页 加入收藏

TOP

子视窗控制项(二十四)
2010-12-30 21:12:42 来源: 作者: 【 】 浏览:32695
Tags:视窗 控制
cy / 8 ;

Triangle (pdis->hDC, pt) ;
pt[0].x = 3 * cx / 8 ; pt[0].y = 5 * cy / 8 ;
pt[1].x = 5 * cx / 8 ; pt[1].y = 5 * cy / 8 ;
pt[2].x = 4 * cx / 8 ; pt[2].y = 7 * cy / 8 ;

Triangle (pdis->hDC, pt) ;
pt[0].x = 3 * cx / 8 ; pt[0].y = 3 * cy / 8 ;
pt[1].x = 3 * cx / 8 ; pt[1].y = 5 * cy / 8 ;
pt[2].x = 1 * cx / 8 ; pt[2].y = 4 * cy / 8 ;

Triangle (pdis->hDC, pt) ;
break ;
}

// Invert the rectangle if the button is selected

if (pdis->itemState & ODS_SELECTED)
InvertRect (pdis->hDC, &pdis->rcItem) ;

// Draw a focus rectangle if the button has the focus

if (pdis->itemState & ODS_FOCUS)
{
pdis->rcItem.left += cx / 16 ;
pdis->rcItem.top += cy / 16 ;
pdis->rcItem.right -= cx / 16 ;
pdis->rcItem.bottom-= cy / 16 ;

DrawFocusRect (pdis->hDC, &pdis->rcItem) ;
}
return 0 ;

case WM_DESTROY :
PostQuitMessage (0) ;
return 0 ;
}
return DefWindowProc (hwnd, message, wParam, lParam) ;
}

该程式在其显示区域的中央包含了两个按钮,如图9-2所示。左边的按钮有四个三角形指向按钮的中央,按下该按钮时,视窗的尺寸将缩小10%。右边的按钮有四个向外指的三角形,按下此按钮时,视窗的尺寸将增大10%。

如果您只需要在按钮中显示图示或点阵图,您可以用BS_ICON或BS_BITMAP样式,并用BM_SETIMAGE讯息设定点阵图。但是,对於BS_OWN

首页 上一页 21 22 23 24 25 26 27 下一页 尾页 24/61/61
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇功能表及其他资源 下一篇计时器

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: