在MFC中使圆形按钮生效 [英] Give Effect on round button in mfc

查看:215
本文介绍了在MFC中使圆形按钮生效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚通过将其设为所有者绘制按钮来创建圆形按钮,并且需要对该按钮生效,现在它看起来不像按钮按钮,而是简单的圆形图.

I just created a round button by making it the button as owner draw and need to give effect on that button , now it appears not like a button button but like a simple round figure

推荐答案

您需要调用Windows API SetWindowRgn.它不仅会创建圆形的可见区域,而且Windowed控件的所有功能都将限于该区域,重要的是鼠标事件.自然地,该区域可以是任何形状,不仅可以是圆形的,还可以通过对基本点集(例如椭圆,矩形等)的理论设置操作的组合来定义.

参见:
http://msdn.microsoft.com/en-us/library/dd145102 (v = vs.85).aspx [
You need to call Windows API SetWindowRgn. Not only it will create rounded visible region, but all functionality of the Windowed control will be limited to the region, importantly — the mouse events. Naturally, the region can be of any shape, not just rounded but defined by a combination of theory-set operations on the primitive point sets such as ellipse, rectangle, etc.

See:
http://msdn.microsoft.com/en-us/library/dd145102(v=vs.85).aspx[^].

—SA


SAKryukov所说的是100%,为了稍微扩展一下,您可以看一下所有
What SAKryukov says is 100%, just in order to extend it a little, you can take a look at all the articles here[^] in CP in which some users have posted different ways to do specially shaped buttons...

PS: remember to filter by MFC ;)

HTH! :thumbsup:


有很多很多的文章 [ ^ ],在此处 CodeProject ,关于圆形按钮.
There are a lot of articles[^], here at CodeProject, about round buttons.


这篇关于在MFC中使圆形按钮生效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆