Solved

Is it possible to have a sidebar number for the rows in an MSFlexgrid

Posted on 2014-09-17
3
80 Views
Last Modified: 2014-09-18
I was wondering in vb6 if it was possible to have a sidebar on the msFlexgrid where it numbers the rows.  Simalar to the same style of a header for a column, except in this case for each row, so that a user could see the amount of rows by number.
0
Comment
Question by:al4629740
  • 2
3 Comments
 
LVL 47

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 40330547
You'll need to add a new first column but then you can do this.

Private Sub Form_Load()

Dim lngRow As Long

MyGrid.FixedCols = 1
For lngRow = 0 To MyGrid.Rows - 1
    MyGrid.TextMatrix(lngRow, 0) = lngRow + 1
Next
End Sub

Open in new window

0
 

Author Comment

by:al4629740
ID: 40330586
Then do I have to manually label them?
0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 40330701
If the number of rows doesn't increase then no, you can just use the code I supplied. If the number of rows increases then do this when you add a new row.

' Add the new row
MyGrid.Rows = MyGrid.Rows + 1

' Number the new row
MyGrid.TextMatrix(MyGrid.Rows - 1, 0) = MyGrid.Rows

Open in new window


In any case I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2014
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…

679 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