A custom control is a control where you take responsibility for everything. This includes
painting it. Owner-draw refers to a technique by which an existing control lets you
"hook" the drawing logic and do the drawing yourself. For example, an owner-draw CListBox
implements all the standard CListBox bheavior (scrolling, selecting, double-clicking,
etc.) and all you have to do is supply a little routine to draw the image. A custom
control that emulated CListBox would have to deal with ALL the details of making a
No. A DLL is merely one way to implement it; you do not need to use a DLL at all for a
custom control. ActiveX controls are different, and they require a separate .DLL file
(called a .OCX file) but I have dozens of custom controls that involve no DLLs at all.
It might be easier to reuse in another project if it is in a DLL, but copying the source
from one project to another works well, too.
Owner-draw may or may not involve changing control colors; the standard controls will
allow changing the colors without creating a "custom" control, just subclassing the
control and implementing an OnCtlColor handler.
Buttons are a bit obnoxious because they require owner-draw to draw the background. But
if you want to have the user select teh parameters, you're in the realm of doing an
ActiveX control and creating custom properties for it, and that's more complex.
If I wanted to do this in a simple fashion, I'd subclass CButton (probably, I'd start with
my Better Bitmap Button class, CImageButton) and add methods the programmer called to set
teh parameters. It is a great deal easier than trying to create a whole OCX button.
Joseph M. Newcomer [MVP]
MVP Tips: http://www.yqcomputer.com/