Click to See Complete Forum and Search --> : How do I make a MsFlexgrid toroidal?
Hugh
Dec 5th, 1999, 09:48 PM
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!
Buzby
Dec 6th, 1999, 04:55 AM
Get hold of Apex's TrueDBGrid - if it's just for an assignment the 30 day demo version available at www.apexsc.com (http://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
BuzbyB@HotMail.Com
MartinLiss
Dec 6th, 1999, 05:35 AM
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.
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
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.