Bonjour,
Voila, j'ai une flexgrid dans mon soft, et j'aimerais placer dans le presse-papier le contenu de la sélection (fait par la souris) de ma flexgrid a l'aide de ctrl+c afin de pouvoir l'exporter vers d'autre fichier.
Je récupère la sélection dans un tableau à 2 dimensions, mais je n'arrive pas à mettre ce tableau dans le presse-papier.
voici la fonction que j'utilise:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
46 Private Sub MSFlexGrid1_KeyPress(KeyAscii As Integer) Dim SelStartRow As Integer Dim SelStartCol As Integer Dim SelEndRow As Integer Dim SelEndCol As Integer Dim SelRows As Integer Dim SelCols As Integer Dim tabl() As String Dim x As Integer Dim y As Integer x = 0 y = 0 If (KeyAscii = 3 And MSFlexGrid1.HighLight) Then SelStartRow = MSFlexGrid1.RowSel SelStartCol = MSFlexGrid1.ColSel SelEndRow = MSFlexGrid1.Row SelEndCol = MSFlexGrid1.Col ReDim tabl(Abs(SelEndRow - SelStartRow), Abs(SelEndCol - SelStartCol)) Clipboard.Clear For SelRows = SelEndRow To SelStartRow For SelCols = SelEndCol To SelStartCol MSFlexGrid1.Row = SelRows MSFlexGrid1.Col = SelCols tabl(x, y) = MSFlexGrid1.Text y = y + 1 Next SelCols x = x + 1 y = 0 Next SelRows Clipboard.SetText tabl 'c'est la que ça bloque End If End Sub
quelqu'un aurait-il une idée à me soumettre?
merci par avance
Partager