在窗体上建一个msflexgrid,一个text框,copy下面代码试一试
Private x, yPrivate Sub FlxG_Scroll()
Text.Visible = False
End SubPrivate Sub FlxG_Click()
With FlxG
Text1.Text = .Col
Text2.Text = .Row
Text.Left = .Left + .CellLeft
Text.Top = .Top + .CellTop
Text.Width = .CellWidth
Text.Height = .CellHeight
Text.Text = .TextMatrix(.Row, .Col)
Text.Visible = True
Text.SetFocus
x = .Row
y = .Col
End With
End Sub
Private Sub text_LostFocus()
Text.Visible = False
FlxG.TextMatrix(x, y) = Text.Text
Data.UpdateRecord
End SubPrivate Sub Form_Click()
Text.Visible = False
End Sub
Private x, yPrivate Sub FlxG_Scroll()
Text.Visible = False
End SubPrivate Sub FlxG_Click()
With FlxG
Text1.Text = .Col
Text2.Text = .Row
Text.Left = .Left + .CellLeft
Text.Top = .Top + .CellTop
Text.Width = .CellWidth
Text.Height = .CellHeight
Text.Text = .TextMatrix(.Row, .Col)
Text.Visible = True
Text.SetFocus
x = .Row
y = .Col
End With
End Sub
Private Sub text_LostFocus()
Text.Visible = False
FlxG.TextMatrix(x, y) = Text.Text
Data.UpdateRecord
End SubPrivate Sub Form_Click()
Text.Visible = False
End Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货