|
-
October 6th, 1999, 09:59 AM
#1
MSFlexGrid
At a complete loss as to how to add titles to the columns in a MSFlexGrid control. Any help for this beginner would be appreciated.
-
October 6th, 1999, 02:01 PM
#2
Re: MSFlexGrid
is the 'title' mean Column heading? if so,
Dim strDBField() As String
Dim iCount As Integer
ReDim strDBField(3)
strDBField(0) = "Month" 'name of the fields.
strDBField(1) = "Total Amount"
' Create number of columns to equal, at least, number of fields.
If flexgrid.Cols < UBound(strDBField, 1) + 1 Then
flexgrid.Cols = UBound(strDBField, 1) + 1
End If
' Populate grid header with field names.
For iCount = 0 To UBound(strDBField, 1)
flexgrid.TextMatrix(0, iCount) = strDBField(iCount)
Next
Hope this helps.
Bill.
-
October 6th, 1999, 03:25 PM
#3
It Works, But...
Thanks for your help Bill; works great!
Except your code leaves me with one unlabeled column at the end. How would I get rid of that?
-
October 7th, 1999, 09:39 AM
#4
Re: It Works, But...
I am sorry. you have to change ReDim strDBField(3) to ReDim strDBField(1) i.e, '1' less than the total no of fields. also in propertypages Generel tab change the cols to 2.
Bill.
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
|