|
-
Jan 28th, 2003, 04:09 PM
#1
Thread Starter
Fanatic Member
FlexGrid.AddItem [RESOLVED]
I'm new to FlexGrids and I'm trying to add a new row to a FlexGrid with the click of a button. Can someone help? Thanks, Jeremy
Last edited by JCScoobyRS; Jan 28th, 2003 at 05:13 PM.
He who listens well, speaks well.
-
Jan 28th, 2003, 04:11 PM
#2
VB Code:
Private Sub Command1_Click()
MSFlexGrid1.AddItem ""
End Sub
If you want to populate the row, delimit the cell data with tabs - Chr(9)
-
Jan 28th, 2003, 04:13 PM
#3
Thread Starter
Fanatic Member
Aaron,
Let's say that I just want to add a new, blank row for learning purposes, can you modify your code to fit my needs? Thanks, Jeremy
He who listens well, speaks well.
-
Jan 28th, 2003, 04:15 PM
#4
That's what the code I supplied does.
-
Jan 28th, 2003, 04:18 PM
#5
Thread Starter
Fanatic Member
Aaron,
Thanks. Say, let's say that I'm doing this to make my FlexGrid resize to fit the number of cells:
Code:
Private Sub Command1_Click()
MSFlexGrid1.AddItem ""
Dim Counter As Long
For Counter = 1 To MSFlexGrid1.Rows - 1
MSFlexGrid1.RowHeight(Counter) = 250
Next
Dim fwidth As Integer, fheight As Integer, f As Integer
For f = 0 To MSFlexGrid1.Cols - 1
fwidth = fwidth + MSFlexGrid1.ColWidth(f)
Next
For f = 0 To MSFlexGrid1.Rows - 1
fheight = fheight + MSFlexGrid1.RowHeight(f)
Next
fheight = fheight + MSFlexGrid1.RowHeight(0)
MSFlexGrid1.Width = fwidth
MSFlexGrid1.Height = fheight
End Sub
Is there a way to make it so that once it hits a certain size it will add the row but not increase the size of the grid? This would also mean enabling the verticle scroll bar. Thanks, Jeremy
He who listens well, speaks well.
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
|