' Déclaration Dim ligDEB As Integer Dim ligFIN As Integer Sub msflog_MouseDown(Button As Integer, ... ligDEB = msflog.MouseRow End Sub Sub msflog_MouseUp(Button As Integer, ... ligFIN = msflog.MouseRow End Sub Sub cmdretirer_Click() Dim i as integer Dim sens as integer sens = 1 If ligFIN < ligDEB Then sens = -1 With msflog .Redraw = False For i = ligDEB To ligFIN Step sens .RemoveItem i ' supprime de msflog cn.Execute "delete ...." ' supprime de tlog Next .Redraw = True End With End Sub
Dim rslog As New ADODB.Recordset rslog.Open "select * from tlog", cn, adOpenDynamic, adLockOptimistic z = msflog.TextMatrix(msflog.Row, 0) For i = 1 To z If msflog.BackColorSel = 1017093 Then msflog.RemoveItem i cn.Execute "delete from tlog where numlog = " & i & " " Else End If Next i
With msflexgrid .Col = 0 For i = 1 .Rows - 1 .Row = i If .CellBackColor = &HF8505 then .Rowheigth(i) = 15 End if Next i End With
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question' En déclaration Dim ligDEB As Integer Dim ligFIN As Integer Dim bShift As Boolean Sub MouseDown bShift = Shift ligDEB = grdTEST.MouseRow End Sub Sub MouseUp Dim i As Integer Dim sens As Integer If bShift False Then bShift Shift If bShift = False Then Exit Sub With grdTEST ligFIN = .MouseRow sens = 1 If ligFIN < ligDEB Then sens = -1 .Redraw = False For i = ligDEB To ligFIN Step sens .RowHeight(i) = 0 Next .Redraw = True End With End Sub
Set rs = New ADODB.Recordset rs.Open "select * from tlog", cn, adOpenDynamic, adLockOptimistic msflog.SelectionMode = flexSelectionByRow msflog.AllowUserResizing = flexResizeBoth msflog.CellBackColor = vbYellow msflog.Rows = 1 msflog.Cols = 0 msflog.FormatString = "Numlog| Historique " Do While Not rs.EOF msflog.AddItem rs!numlog & vbTab & rs!operation rs.MoveNext Loop rs.Close
Tant que msflog n'est pas arrivé à la fin si une ligne = vbyellow (donc est sélectionnée) alors supprimer cette ligne de tlog et de msflog Finsi FinTantQue
With msflog: .Col 0: .Row .MouseRow .CellBackColor = vbRed End with
' Déclaration Dim ligDEB As Integer Dim ligFIN As Integer Sub msflog_MouseDown(Button As Integer, ... ligDEB = msflog.MouseRow End Sub Sub msflog_MouseUp(Button As Integer, ... ligFIN = msflog.MouseRow End Sub Sub cmdretirer_Click Dim i as integer Dim sens as integer sens = 1 If ligFIN < ligDEB Then sens = -1 With msflog .Redraw = False For i = ligDEB To ligFIN Step sens .RowHeight(i) = 0 Next .Redraw = True End With End Sub
Sub cmdretirer_Click() Dim x As Integer Dim y As Integer Dim nCOL As Integer Dim nSEL As Integer Dim nLIG As Integer ' si sélection des lignes de bas en haut If ligDEB > ligFIN Then temp = ligDEB ligDEB = ligFIN ligFIN = temp End If nSEL = (ligFIN - ligDEB) + 1 With msflog nCOL = .Cols - 1 nLIG = .Rows - nSEL .Redraw = False For y = ligDEB To nLIG For x = 0 To nCOL .TextMatrix(y, x) = .TextMatrix(y + nSEL, x) Next x Next y .Rows = .Rows - nSEL .Redraw = True End With End Sub
cn.Execute "delete from tlog where numlog = " & i & " "
cn.Execute "delete from tlog where numlog = " & i & " "