VB 6.0中用msflexgrid控件修改数据库的代码怎么写 5
展开全部
'MSHFlexGrid1是不能输入的,只有通过一个text来输入
Private Sub MSHFlexGrid1_Click()
Dim i As Long
With MSHFlexGrid1
If .Col = 1 Then
Text1.Text = Trim(.Text)
Text1.Left = .CellLeft - 10
Text1.Top = .CellTop - 10
Text1.Height = .CellHeight
Text1.Width = .CellWidth
Text1.Visible = True
Text1.SetFocus
Else
Text1.Visible = False
End If
End With
End Sub
'在text1中回车
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
'这里放入修改数据库的代码
End If
End Sub
Private Sub MSHFlexGrid1_Click()
Dim i As Long
With MSHFlexGrid1
If .Col = 1 Then
Text1.Text = Trim(.Text)
Text1.Left = .CellLeft - 10
Text1.Top = .CellTop - 10
Text1.Height = .CellHeight
Text1.Width = .CellWidth
Text1.Visible = True
Text1.SetFocus
Else
Text1.Visible = False
End If
End With
End Sub
'在text1中回车
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
'这里放入修改数据库的代码
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询