MSHFlexGrid ColWidth property returns -1 ( default ) 
Author Message
 MSHFlexGrid ColWidth property returns -1 ( default )

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 de{*filter*}
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



Sat, 13 Mar 2004 15:59:21 GMT  
 MSHFlexGrid ColWidth property returns -1 ( default )

Quote:
>Used so when the mouse
>goes outside this area it doesn't display tooltips.

You can use the values of MouseCol and MouseRow to determine
if the mouse is not over a cell.

J


Tue, 25 Sep 2001 07:59:21 GMT bearing the following fruit:

Quote:
>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 de{*filter*}
>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



Sat, 13 Mar 2004 18:49:09 GMT  
 MSHFlexGrid ColWidth property returns -1 ( default )
Here is a formula that works great for calculating the height of a DataGrid.
See if you can modify it to your needs with the MSHFlexGrid.

  Me!DataGrid1.Height = (Int((Me.ScaleHeight - Me!DataGrid1.Top - 645) / _
 (Me!DataGrid1.RowHeight + 15)) * (Me!DataGrid1.RowHeight + 15)) - 30

The 645 is # of twips from bottom of grid to bottom of client area of
screen. The 30 is just a tweak to thin the bottom line of my grids.


Quote:
> 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 de{*filter*}
> executing the commands, MSHFlexGrid1.RowHeight(0) or

MSHFlexGrid1.ColWidth(0),
Quote:
> 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



Mon, 15 Mar 2004 01:28:49 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. MSHFlexGrid Colwidth = 0

2. MSHFlexGrid ColWidth

3. MSHFlexGrid.colwidth(0) Problem

4. Setting ColWidth in MSHFlexGrid ??

5. Setting ColWidth in MSHFlexGrid ??

6. Q: Strange ColWidth property behavior

7. BUG: Default property returning null

8. BUG: Default property returning null

9. default property not displayed in properties window.

10. MSHFlexGrid Selected Property

11. MSHFlexgrid ColHeaderCaption property

12. MSHFlexGrid - Clip property

 

 
Powered by phpBB® Forum Software