|
-
Dec 5th, 1999, 10:48 PM
#1
Thread Starter
New Member
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!
-
Dec 6th, 1999, 05:55 AM
#2
Frenzied Member
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]
-
Dec 6th, 1999, 06:35 AM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|