Schamann.net

…děláme vJeci jinak…
Previous Post:   Next Post:

MSHFlexGrid a schránka

Tady je několik jednoduchých funkcí pro práci s MSHFlexGrid a schránkou – Kopírování dat do a z a podobné funkce.

‚Vyjmutí – Ctrl+X
Private Sub EditCut()
EditCopy
EditDelete
End Sub

‚Kopírování – Ctrl+C
Private Sub EditCopy()
Clipboard.Clear
Clipboard.SetText MSFlexGrid1.Clip
End Sub

‚Vložení Ctrl+V
Private Sub EditPaste()
If Len(Clipboard.GetText) Then MSFlexGrid1.Clip = _
Clipboard.GetText
End Sub

‚Smazat označené Del
Private Sub EditDelete()
Dim i As Integer
Dim j As Integer
Dim strClip As String
With MSFlexGrid1
For i = 1 To .RowSel
For j = 1 To .ColSel
strClip = strClip & „“ & vbTab
Next
strClip = strClip & vbCr
Next
.Clip = strClip
End With
End Sub

‚Vyber vše Ctrl+A
Private Sub EditSelectAll()
With MSFlexGrid1
.Visible = False
.row = 1
.col = 1
.RowSel = .Rows – 1
.ColSel = .Cols – 1
.TopRow = 1
.Visible = True
End With
End Sub

Posted in Visual Basic 8 years, 10 months ago at 16:28.

Add a comment

Comments are closed.