Announcement

Collapse
No announcement yet.

EGrid32 virtual mode

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Paul Squires
    replied
    Thanks Elias, worked perfectly!

    Leave a comment:


  • Elias Montoya
    replied
    This should work for Rows only:

    Code:
    '-------------------------------------------------------------------------------------------
    '  Sets the number of rows for the grid.
    '-------------------------------------------------------------------------------------------
    FUNCTION EZ_SetEgridRows(BYVAL Hgrid AS DWORD, BYVAL Y AS LONG) AS LONG
      LOCAL Ysize AS LONG
      LOCAL Result AS LONG
       Ysize = SendMessage(Hgrid, %EG_GETMAXROWS, 0, 0)
       IF Y > Ysize THEN
        FUNCTION = SendMessage(Hgrid, %EG_APPENDROW, (Y-Ysize), 0)
       ELSEIF Y < Ysize THEN
        FUNCTION = SendMessage(Hgrid, %EG_KILLROW, (Ysize-Y), 0)
       ELSE
        FUNCTION = %TRUE
       END IF
    END FUNCTION
    '--------------------------------------------------------------------------

    Leave a comment:


  • Elias Montoya
    replied
    You can use this function paul, it works in any running mode:

    Code:
    '-------------------------------------------------------------------------------------------
    '  Sets the size for the Grid.
    '-------------------------------------------------------------------------------------------
    FUNCTION EZ_SetEgridSize(BYVAL Hgrid AS DWORD, BYVAL X AS LONG, BYVAL Y AS LONG) AS LONG
      LOCAL Xsize AS LONG
      LOCAL Ysize AS LONG
      LOCAL Result AS LONG
       Xsize = SendMessage(Hgrid, %EG_GETMAXCOLUMNS, 0, 0)
       Ysize = SendMessage(Hgrid, %EG_GETMAXROWS, 0, 0)
       IF X > Xsize THEN
        Result = Result + IIF(SendMessage(Hgrid, %EG_APPENDCOLUMN, (X-Xsize), 0), 1,0)
       ELSEIF X < Xsize THEN
        Result = Result + IIF(SendMessage(Hgrid, %EG_KILLCOLUMN, (Xsize-X), 0), 1, 0)
       ELSE
        INCR Result
       END IF
       IF Y > Ysize THEN
        Result = Result + IIF(SendMessage(Hgrid, %EG_APPENDROW, (Y-Ysize), 0),1, 0)
       ELSEIF Y < Ysize THEN
        Result = Result + IIF(SendMessage(Hgrid, %EG_KILLROW, (Ysize-Y), 0), 1, 0)
       ELSE
        INCR Result
       END IF
      FUNCTION = (Result = 2)
    END FUNCTION
    '--------------------------------------------------------------------------

    Leave a comment:


  • Paul Squires
    started a topic EGrid32 virtual mode

    EGrid32 virtual mode

    I am using Elias' EGrid32 and I need to know how to set the number of rows when the grid is in virtual mode. I know I can set it when the grid is created but my data changes as the application executes so I need to be able to tell the grid that the number of rows is increased/decreased.
Working...
X