Results 1 to 3 of 3

Thread: How do I make a MsFlexgrid toroidal?

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    9

    Post

    Does anyone have any ideas on how I make a flex grid "wrap around" (so that left column cells are considered adjacent to right column etc...)

    Class assignment - I have to code the Game of Life using a grid control, but I can't figure this out. Thanks for any help you can give!

  2. #2
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670

    Post

    Get hold of Apex's TrueDBGrid - if it's just for an assignment the 30 day demo version available at www.apexsc.com will do.
    With this grid control you can set AllowArrows=TRUE (this may even work on the FlexGrid, I'm not sure) and this will let you do what you want to do.
    Also, the TrueDBGrid can be bound to an Array-type object called an X-Array which would make your game of life a lot easier to sort out.



    ------------------
    Mark "Buzby" Beeton
    VB Developer
    [email protected]



  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    Here is a small subroutine that does part of the work for you. You pass it the data and the column and row where it goes. If the column or row is too large, it wraps. You would need to write the code to do similar stuff if the row and/or column where < 0.
    Code:
    Public Sub AddData(nRow As Integer, nColumn As Integer, sText As String)
    
        If nColumn > MSFlexGrid1.Cols - 1 Then
            nRow = nRow + 1
            nColumn = 0
        End If
        
        If nRow > MSFlexGrid1.Rows - 1 Then
            nRow = 0
        End If
        
        MSFlexGrid1.Col = nColumn
        MSFlexGrid1.Row = nRow
        MSFlexGrid1.Text = sText
        
    End Sub
    ------------------
    Marty

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