Is there any chance to use CSplitButton in VC6 ?
I had tried to use something appropriate founded on CP, but they are using DrawItem, and I had problems with windows style, and I had tried to make myself one, overriding OnPaint, but I front with flickering (I put the sample below)... so, I wonder if I could get (from somewhere) CSplitButton and add to my project ... if you say that I could, can you provide me the CSplitButton source code ? I mean, only .cpp implementation file ...
Thank you.
Last edited by mesajflaviu; December 5th, 2013 at 08:17 AM.
Much simpler:
If the target OS is Windows Vista or newer, you can make from an ordinary push button a split button by adding BS_SPLITBUTTON or BS_DEFSPLITBUTTON style.
Next, just handle BCN_DROPDOWN (reflected) notification and do something cool, e.g. show a drop-down menu.
Example
Code:
// MySplitButton.h
#pragma once
class CMySplitButton : public CButton
{
// ...
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual void PreSubclassWindow();
// ...
afx_msg void OnBnDropDown(NMHDR *pNMHDR, LRESULT *pResult);
};
Alternatively and much better, get rid of old VS6.0 and use a newer one. Visual Studio 2008 and newer, comes with a split button control resource and a CSplitButton class which
do the work for you.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.