------------------------------------------------------------------------
 Excel-like Cell Truncation for iGrid ActiveX
 
 Control Version: 3.0
 Environment: Visual Basic 6

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

Description
===========
By default, an ellipsis is displayed at the end of the cell text if the text is clipped in iGrid, but this sample demonstrates how to display a series of the "#" symbol instead  like in MS Excel.

Short Code Explanation
======================
The CellDynamicText event of iGrid is used in this sample to substitute the normal cell text with #s when the cell text cannot be displayed in the cell without clipping.

A special flGetTextWidth function implemented in the sample is used to calculate the width of the specified text. Note that you cannot use the built-in EvaluateTextWidth function for that because it calls CellDynamicText which causes an infinite loop and the "Out of stack" error. This function takes into account the font of the cell being drawn. It can also be used in your applications if you need to calculate the width of a string using the specified font effectively  it works very fast because it is based on Windows API calls.

Pay attention to the fact that when you double-click a column header divider to automatically fit the width of the column, the conversion of the cell texts to #s are temporarily turned off to calculate the column width properly based on the real cell texts (see the ColDividerDblClick event sub).
