Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

An elliptical button class with bitmap

0.00/5 (No votes)
30 Aug 2004 1  
An article on an elliptic button class supporting bitmaps.

Introduction

The idea of this class comes from the CRoundButton class from Chris Maunder. I was mainly missing elliptical forms and bitmaps in this class. The elliptical form is based on the bounds of the rectangle of the button. All properties can be set in the resource editor of the developer studio.

Using the code

This class can be used like any other owner drawn control - simply include the header file, and declare your button controls as CEllipticButton instead of CButton.

Points of Interest

I combine all bitmap and text information to one bitmap. So, I must handle only one case. If you want a bitmap button without text, you must set an empty title.

The supported properties are BS_FLAT, WS_EX_RIGHT, BS_RIGHT, BS_LEFT, BS_TOP, BS_BOTTOM, BS_CENTER, BS_VCENTER, BS_MULTILINE, and BS_BITMAP.

In the second version, I supported the Windows system colors for text and the disabled picture.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here