Year and Month Selector Control (2) | CodeGuru

Year and Month Selector Control (2)

One of the things I love about CodeGuru is that you can modify the examples to look just how you want them to, not how someone else wants them to. Recently I needed a control that would enable the user to to select just the month, and year, NOT the day. Shekar Naranan‘s Year and […]

Written By
CodeGuru Staff
CodeGuru Staff
Dec 6, 1998
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

ymselect2.gif (5608 bytes)

One of the things I love about CodeGuru is that you can modify the examples to look
just how you want them to, not how someone else wants them to. Recently I needed a control
that would enable the user to to select just the month, and year, NOT the day. Shekar Naranan‘s Year and Month Selector Control
was just what I had been looking for. It was a very useful piece of code, however it just
seemed rather "flat" to me, so I decided to change the look of it and along the
way I added other features to it.

  • The popup window now has a 3D border, the cell border have been removed, and the popup
    window has been shrunk. Also other minor costmetic alterations have been made.
  • Cursor Keys. When the popup window is displayed the cursur / arrow keys
    may be used to move the selection.
  • Space / Return Keys. Pressing the space bar or the return key within
    the popup window now chooses the current selection.
  • "Cool Look" Flat Buttons. The "<<" and
    ">>" keys have now been made into cool look flat buttons.
  • Keith Rules CMemDC class used to stop flickering.

  For an explantion on how to use this class please refer to Shekar’s original
article here.

Download Example Project – 24 KB

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.