CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2000
    Location
    CA, USA
    Posts
    88

    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 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




  2. #2
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: MSHFlexGrid ColWidth property returns -1 ( default )

    Why not just use the .Width and .Height properties?

    John G

  3. #3
    Join Date
    Jul 2000
    Location
    CA, USA
    Posts
    88

    Re: MSHFlexGrid ColWidth property returns -1 ( default )

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured