Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

MSFlexgrid Scroll event problem

I have problem in using MSflexgrid scroll event. I not able to hide floating textbox whenever particular column is not in visible.
here i written my code which i used in my application.
Here, when i click third visible column the grid automtically scrolls and third visible column become second visible column. At this time when i click scroll bar in the left side its not moving. Can you please guide me how to rectify this problem?

------------------------------
Public Sub ChangeCelltxt() ' Move Textbox to active cell.
On Error GoTo Errhandle:
If MSFlexGrid1.Enabled = False Then Exit Sub
With MSFlexGrid1
Text1.Move .Left + .CellLeft, .Top + .CellTop, .CellWidth, .CellHeight
Text1.Visible = True
Text1.SetFocus
Text1.ZOrder 0
End With
Exit Sub
Errhandle:
MsgBox Err.Description
End Sub

Private Sub Form_Load()
With MSFlexGrid1
.Rows = 10
.Cols = 10
.Height = 1935
.Width = 4095
For i = 0 To .Cols - 1
.TextMatrix(0, i) = i
Next
.Col = 1
.Row = 1
Text1.Move .Left + .CellLeft, .Top + .CellTop, .CellWidth, .CellHeight
Text1.Visible = True
Text1.ZOrder 0
End With
End Sub

Private Sub MSFlexGrid1_Click()
Call ChangeCelltxt
End Sub

Private Sub MSFlexGrid1_Scroll()
If MSFlexGrid1.ColIsVisible(MSFlexGrid1.Col) And MSFlexGrid1.RowIsVisible(MSFlexGrid1.Row) Then
Call ChangeCelltxt
Else
Text1.Visible = False
End If
End Sub

Sign In or Register to comment.