Solved

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

Posted on 2014-09-17
3
83 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

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…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

752 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