1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
Public NumberRow, NumberCol As Integer
Private Sub Saisie()
'Recherche des coordonnées de la cellule active
Dim x, y As Integer
x = Grid1.Left + Grid1.CellLeft
y = Grid1.Top + Grid1.CellTop
'Mémorisation de la ligne et colonne active
NumberRow = Grid1.MouseRow
NumberCol = Grid1.MouseCol
'Initialisation de l'objet tampon
Text1.Left = x
Text1.Top = y
Text1.Width = Grid1.CellWidth
Text1.Height = Grid1.CellHeight
Text1.Visible = True
Text1.Text = Grid1.Text
Text1.SetFocus
End Sub
Private Sub Grid1_Click()
Call Saisie
End Sub
Private Sub Grid1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = &H27 Then 'vbKeyRight Then
Call Saisie
End If
End Sub
Private Sub Grid1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = 2 Then
PopupMenu MnuContext
End If
End Sub
Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
Grid1.Row = NumberRow
Grid1.Col = NumberCol
Grid1.Text = Text1.Text
End Sub
Private Sub MnuParam_click()
frmParam.Show
End Sub |
Partager