Solved

Text in top row of FlexGrid?

Posted on 2002-03-18
4
251 Views
Last Modified: 2009-07-29
How do you put text in the top rows of a MSFlexGrid? I can put stuff in all the grids, but not the top row. I am using VB6.
0
Comment
Question by:vmaxx
4 Comments
 
LVL 49

Accepted Solution

by:
Ryan Chong earned 50 total points
ID: 6876358
What do you mean by Not the Top Row?

MSFlexGrid1.TextMatrix(0, 1) = "Hello World!" ?

0
 
LVL 18

Expert Comment

by:mdougan
ID: 6876791
There are two ways of putting text in the top row of the flexgrid.  First, is using TextTatrix with a row index of zero like ryancys has suggested.  You can also use the FormatString property:

tblCustomers.FormatString = "CustNo|Cust Name|Balance"

You'd have to look at the colseparators (?) property.  I think that the pipe symbol separates the columns, but it could be a vbTab character.  You can also include special characters that tell the grid whether to right-align, center or left-align the column:

tblCustomers.FormatString = "^CustNo|<Cust Name|>Balance"
0
 
LVL 1

Expert Comment

by:Barraza
ID: 6878885
I had the same problem.  This is how I added the first row and then removed the top "blank" row.

FlexGrid1.AddItem "Column1" & vbTab & "Column2" & vbTab & "Column3"

If FlexGrid1.TextMatrix(1, 1) = "" Then FlexGrid1.RemoveItem (1)


0
 
LVL 1

Author Comment

by:vmaxx
ID: 6879265
Thats it, I can't tell you how long I went through the help files looking for that simple command.

thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now