Solved

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

Posted on 2014-09-17
3
70 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 45

Accepted Solution

by:
Martin Liss earned 500 total points
Comment Utility
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
Comment Utility
Then do I have to manually label them?
0
 
LVL 45

Expert Comment

by:Martin Liss
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

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…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

772 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

11 Experts available now in Live!

Get 1:1 Help Now