I have a VB6 app. that utilizes an MSFLexgrid control. The first 2 columns are fixed, as is the first row which contains the column headings.
This is a sales forecasting app. There are a total of 73 columns, which include 6 columns for each month of the year (i.e., prior year forecasted amt., actual amt., percentage difference, then the current year forecast and actual amounts, and then another calculated column for the difference of those two values)
So, for example, columns 44-50 could have column names:
AugPYF-AugPYA-%diff-AugCYF-AugCYA-%diff
Right now, if the user has the flexgrid control scrolled all the way to the left, which would show the January columns(JanPYF, JanPYA, etc.), I would like to be able to have them choose a month, say, August, from a dropdown, click a button, and have the MSFlexgrid "scroll" to the right until the month-chosen-column is at the very left(that is, the flexgrid scrolls to the right until the columns for "Aug" are visible).
The idea is to elimnate the need for the user to have to manually scroll through dozens of columns to find the particular column they need to view.
I tried using a setfocus routine, which does set the focus, but does not actually move the grid to the desired column:
EXAMPLE:
So, is it poossible to programmitcally scroll the MSFlexgrid to the desired column?
If so, anyone have some sample code?
Sorry for the long-winded post and much obliged in advance for any help. I am stumped.
JBG
This is a sales forecasting app. There are a total of 73 columns, which include 6 columns for each month of the year (i.e., prior year forecasted amt., actual amt., percentage difference, then the current year forecast and actual amounts, and then another calculated column for the difference of those two values)
So, for example, columns 44-50 could have column names:
AugPYF-AugPYA-%diff-AugCYF-AugCYA-%diff
Right now, if the user has the flexgrid control scrolled all the way to the left, which would show the January columns(JanPYF, JanPYA, etc.), I would like to be able to have them choose a month, say, August, from a dropdown, click a button, and have the MSFlexgrid "scroll" to the right until the month-chosen-column is at the very left(that is, the flexgrid scrolls to the right until the columns for "Aug" are visible).
The idea is to elimnate the need for the user to have to manually scroll through dozens of columns to find the particular column they need to view.
I tried using a setfocus routine, which does set the focus, but does not actually move the grid to the desired column:
EXAMPLE:
Code:
Private Sub Command2_Click()
With MSFlexGrid1
.Col = 0
.Row = 2
.ColSel = 1
.RowSel = 4
.SetFocus
End With
End Sub
So, is it poossible to programmitcally scroll the MSFlexgrid to the desired column?
If so, anyone have some sample code?
Sorry for the long-winded post and much obliged in advance for any help. I am stumped.
JBG