Solved

Text in top row of FlexGrid?

Posted on 2002-03-18
4
266 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 51

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

820 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