Introduction - If you have any usage issues, please Google them yourself
There are many owner-draw button written using C++ and the MFC classes. There a lso many ActiveX controls, mostly written in Visual Basic. While with C++ you can easily use both the MFC and the OCX controls, with Visual Basic you need to convert the MFC objects to an activex control. Unluckily, the class wizard doesn t cover all the messages and the events sent to an ActiveX control, and some messages are different, so most of the magic must be hand written. Because sometimes a piece of code is more clear than the article itself, I included the porting of CxShadeButton to an ActiveX control, but it s just an example, in the article I will speak about a generic AxButtonCtrl.
Packet : 111186759activexshadebutton.zip filelist
AxShadeButton.clw
AxShadeButton.cpp
AxShadeButton.def
AxShadeButton.dsp
AxShadeButton.dsw
AxShadeButton.h
AxShadeButton.odl
AxShadeButton.rc
AxShadeButtonCtl.bmp
AxShadeButtonCtl.cpp
AxShadeButtonCtl.h
AxShadeButtonPpg.cpp
AxShadeButtonPpg.h
CxShadeButton.htm
resource.h
StdAfx.cpp
StdAfx.h
vb/AxShadeButton.ocx
vb/Form1.frm
vb/icon1.ico
vb/icon2.ico
vb/Project1.exe
vb/Project1.vbp
vb/Project1.vbw
vb/rc.bat
vb/Script1.rc
vb/script1.RES
xShadeButton.cpp
xShadeButton.h