------------------------------------------------------------------------
 Command Button Cells Sample for iGrid ActiveX
 
 Control Version: 4.0
 Environment: Visual Basic 6

 Copyright (c) 10Tec Company. All rights reserved.
------------------------------------------------------------------------

Description
===========
The iGrid custom drawn cells can be used to implement any cell type you need, including command button cells. This demo gives you a technique you can use to incorporate buttons into your iGrid's.
In such modern versions of Windows as Windows XP, Vista and 7, the cell buttons are drawn using the current visual style (but optionally this feature can be turned off).

Developer's Tips
================
The standard Windows buttons can be drawn with the WinAPI DrawFrameControl function. The MouseDown/MouseUp events of iGrid are used to determine the cell and button under the mouse pointer; you can also redraw your buttons accordingly to their pressed state in these events. The demo uses the MouseEnter and MouseLeave events to redraw the state of a pressed button in the case the user has pressed the button and moves the mouse pointer without releasing the mouse button outside of the button cell.

The information about each button is represented with a two-item array - an instance of such an array is stored as the cell value in the button cells. iGrid allows you to do that as its cell value has the Variant data type, and this "structure" can be extended to store other additional properties of your buttons.

Special thanks to Steve McMahon for its perfect cUxTheme class we use to draw styled buttons in the latest versions of MS Windows. The original source code of this class and related info can be found at

http://vbaccelerator.com/home/VB/Code/Libraries/XP_Visual_Styles/Drawing_with_XP_Visual_Styles/article.asp

The code also uses the IFont interface hidden in VB to retrieve the API handle for the font used to draw button captions and to clone the grid's font.
