Click to See Complete Forum and Search --> : MSHFlexGrid ColWidth property returns -1 ( default )


mrhicks
September 24th, 2001, 08:29 PM
Hello all,

I have this same MSHFlexGrid control on my form. At a specific time I would like to know what the total length of the of rows by adding the columns together and the total height by adding all the rows in a columns together. This gives me the outter most perimeter of the grid. Used so when the mouse goes outside this area it doesn't display tooltips. Any how, when to go to determine these values I am running into problems. By using the debugger executing the commands, MSHFlexGrid1.RowHeight(0) or MSHFlexGrid1.ColWidth(0), it is returning a resultant of -1, which is the default values. From MSDN

You can set ColWidth to zero to create invisible columns, or to –1 to reset the column width to its default value, which depends on the size of the current font.

Okay, so a setting of -1 is the default value, that is fine and dandy, but I need to extract the actually value of the width and height. How do I get these values correctly. MSDN defines the default to be based upon the size of the currently font, but how do I get the width and height of a cell from that? Font.Size * screen.TwipsPerPixelX ?? That doesn't seem to work either. Maybe there is an easier way to determine the total length and height of the grid????

Thanks

Mark

John G Duffy
September 25th, 2001, 09:40 AM
Why not just use the .Width and .Height properties?

John G

mrhicks
September 25th, 2001, 10:32 AM
This only gives me the Height and Width of the actual control, which I do not need. I am displaying a ToolTip with additional information when the mouse cursor is over a particular row and only want to display the tooltip info when the curosr is within the actual grid. If the grid is large enough there is a blank space per se and I don't want it to show the tooltip info when in this area.

Mark